A057331 a(n) = smallest prime p such that the first n iterates of p under x->2x+1 are all primes.
2, 2, 2, 2, 2, 89, 1122659, 19099919, 85864769, 26089808579, 554688278429, 554688278429, 4090932431513069, 95405042230542329
Offset: 0
Examples
a(5) = 89 because the numbers 89, 179, 359, 719, 1439, 2879 are all primes and 89 is the first number to have this property.
Links
Crossrefs
Programs
-
Mathematica
f[n_] := 2n + 1; k = 1; Do[ While[ Union[ PrimeQ[ NestList[ f, Prime[k], n]]] != {True}, k++ ]; Print[ Prime[k]], {n, 1, 9} ]
-
PARI
has(p,n)=for(k=1,n,if(!isprime(p), return(0)); p=2*p+1); isprime(p) a(n)=forprime(p=2,, if(has(p,n), return(p))) \\ Charles R Greathouse IV, Apr 29 2015
Extensions
More terms from Farideh Firoozbakht, Apr 24 2004
a(11) (from the Caldwell link) sent by Peter Deleu, Hulste, Belgium, Nov 22 2004
a(13) added from A005602, Paul Zimmermann, Mar 09 2018
Comments