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.

A122396 Least k>1 such that p^k - p^(k-1) - 1 is prime for p = prime(n).

Original entry on oeis.org

3, 2, 2, 2, 2, 3, 2, 7, 56, 2, 2, 8, 8, 8, 2, 4, 4, 2, 2, 2, 9, 3, 21496, 26, 2, 2, 4, 38, 7, 286644, 2, 2, 26, 2, 2, 4, 4, 15, 4, 24, 16, 2, 264, 4, 2, 3, 24, 3, 516, 6
Offset: 1

Views

Author

T. D. Noe, Aug 31 2006

Keywords

Comments

Does a(n) always exist? Note that k cannot be 5, 11, 17,... (i.e., k=5 mod 6) because then p^2 - p + 1 divides p^k - p^(k-1) - 1.
From Richard N. Smith, Jul 15 2019: (Start)
The link has the primes 82*83^21495-1 = 83^21496-83^21495-1 and 112*113^286643-1 = 113^286644-113^286643-1, thus a(23)=21496 and a(30)=286644.
a(51) > 250000, since 232*233^k-1 is composite for all k<=250000, see link.
a(52) - a(61) = {4, 2, 80, 14, 76, 2, 90, 6, 80, 769}, a(62) > 200000. (End)

Crossrefs

Programs

  • Mathematica
    lst={}; Do[p=Prime[n]; k=2; While[m=p^k-p^(k-1)-1; !PrimeQ[m], k++ ]; AppendTo[lst,k], {n,22}]; lst
  • PARI
    a(n)=for(k=2, 10^6, if(ispseudoprime(prime(n)^k - prime(n)^(k-1) - 1), return(k))) \\ Richard N. Smith, Jul 15 2019

Extensions

a(23)-a(50) from Richard N. Smith, Jul 15 2019, using Steven Harvey's table.