cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A219432 Least 3-smooth number k such that prime(n)*k - 1 is prime.

Original entry on oeis.org

2, 1, 4, 2, 4, 8, 4, 2, 6, 6, 2, 2, 4, 6, 6, 4, 6, 8, 6, 4, 108, 2, 4, 16, 2, 24, 6, 6, 6, 6, 6, 4, 4, 2, 12, 12, 2, 6, 12, 4, 18, 8, 24, 8, 4, 2, 2, 8, 4, 2, 16, 6, 18, 12, 12, 4, 6, 2, 12, 4, 6, 4, 2, 72, 6, 6, 2, 2, 6, 8, 16, 6, 2, 6, 2, 4, 6, 6, 24, 8, 16, 12
Offset: 1

Views

Author

Lei Zhou, Nov 19 2012

Keywords

Comments

Conjecture: a(n) < prime(n) for n > 21. Conjecture confirmed up to a(122578) = 55296 < prime(122578) = 1620539.

Examples

			prime(1) = 2, 2 * 2 - 1 = 3 is prime, so a(1)=2;
prime(2) = 3, 3 * 1 - 1 = 2 is prime, so a(2)=1;
......
prime(6) = 13, 13 * 2 - 1 = 25 is not prime,
           13 * 3 - 1 = 38 is not prime,
           13 * 4 - 1 = 51 is not prime,
           13 * 6 - 1 = 77 is not prime,
           13 * 8 - 1 = 103 is prime, so a(6)=8.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p2, p3 = 3^Range[0, Floor@ Log[3, n] + 1]}, p2 = 2^Floor[Log[2, n/p3] + 1]; Min[ Select[ p2*p3, IntegerQ]]]; Table[pr=Prime[i]; j=1; fj=0; While[j++; fj=f[fj+0.5]; cp=-1+pr*fj; !PrimeQ[cp]]; fj, {i, 116}]

A357746 Primes p such that the least k for which k*p + 1 is prime is also the least k for which k*p - 1 is prime.

Original entry on oeis.org

47, 103, 107, 283, 313, 347, 397, 773, 787, 907, 1051, 1117, 1319, 1433, 1823, 2027, 2153, 2203, 2287, 2333, 2347, 2381, 2909, 3221, 3257, 3673, 3923, 3929, 4129, 4153, 4217, 4547, 4597, 4657, 4721, 4969, 5023, 5387, 5407, 5693, 5717, 5827, 5881, 6373, 6781, 6863, 6997
Offset: 1

Views

Author

Karl-Heinz Hofmann, Jan 01 2023

Keywords

Comments

If A035096(n) = A216568(n) the n-th prime is a term. Here k*p must be the composite number sandwiched between a pair of twin primes, so by Wilson's theorem, k must be a multiple of 6.

Examples

			a(1) = 47: 47*6 + 1 = 283 (a prime), 47*6 - 1 = 281 (also a prime), and no k < 6 gives a prime as the result for both formulas.
		

Crossrefs

Programs

  • Mathematica
    q[p_] := Module[{k = 1, r}, While[! Or @@ (r = PrimeQ[k*p + {-1, 1}]), k++]; And @@ r]; Select[Prime[Range[900]], q] (* Amiram Eldar, Jan 01 2023 *)
  • PARI
    isk(p, x) = my(k=1); while (!isprime(k*p+x), k++); k;
    isok(p) = if (isprime(p), isk(p, +1) == isk(p, -1)); \\ Michel Marcus, Jan 01 2023
  • Python
    from sympy import sieve, isprime
    def leastk(p, plusminus):
        k=1
        while not isprime(k * p + plusminus): k += 1
        return k
    print([p for p in sieve[1:1000] if leastk(p, 1) == leastk(p, -1)])
    
Showing 1-2 of 2 results.