A058013 Smallest prime p such that (n+1)^p - n^p is prime.
2, 2, 2, 3, 2, 2, 7, 2, 2, 3, 2, 17, 3, 2, 2, 5, 3, 2, 5, 2, 2, 229, 2, 3, 3, 2, 3, 3, 2, 2, 5, 3, 2, 3, 2, 2, 3, 3, 2, 7, 2, 3, 37, 2, 3, 5, 58543, 2, 3, 2, 2, 3, 2, 2, 3, 2, 5, 3, 4663, 54517, 17, 3, 2, 5, 2, 3, 3, 2, 2, 47, 61, 19, 23, 2, 2, 19, 7, 2, 7, 3, 2, 331, 2, 179, 5, 2, 5, 3, 2, 2
Offset: 1
Links
- Robert Price and Robert G. Wilson v, Table of n, a(n) for n = 1..138
- Jean-Louis Charton and Robert G. Wilson v, a(n) for n=1..1000 status
- Richard Fischer, Generalized primes of the form (B+1)^N - B^N.
Crossrefs
Programs
-
Mathematica
lmt = 10000; f[n_] := Block[{p = 2}, While[p < lmt && !PrimeQ[(n+1)^p - n^p], p = NextPrime@ p]; If[p > lmt, 0, p]]; Do[ Print[{n, f[n] // Timing}], {n, 1000}] (* Robert G. Wilson v, Dec 01 2014 *) spp[n_]:=Module[{p=2},While[!PrimeQ[(n+1)^p-n^p],p=NextPrime[p]];p]; Array[spp,90] (* Harvey P. Dale, Jul 01 2025 *)
-
PARI
a(n)=forprime(p=2,default(primelimit),if(ispseudoprime((n+1)^p-n^p),return(p))) \\ Charles R Greathouse IV, Feb 20 2012
Formula
a((p-1)/2) = 2 for odd primes p. - Alexander Adamchuk, Dec 01 2006
Extensions
More terms from T. D. Noe, Dec 05 2005
Typo in first Mathematica program corrected by Ray Chandler, Feb 22 2017
Comments