OFFSET
1,4
LINKS
Henri Lifchitz and Renaud Lifchitz, PRP Top Records
EXAMPLE
For Mersenne 5, i.e., 8191, the first computed prefix is equal to 1 and gives 18191 which is also a prime, so a(5) = 1.
MATHEMATICA
pfx[n_] := Module[{w = 10^(1+Floor[Log10[n]])}, k=n+w ; While[!PrimeQ[k], k+=w]; Floor[k/w]]; s={}; Do[m = 2^MersennePrimeExponent[n]-1; AppendTo[s, pfx[m]], {n, 1, 12}]; s (* Amiram Eldar, Nov 22 2018 based on Andrew Howroyd's pari code *)
PROG
(PARI)
pfx(n)={my(w=10^(1+logint(n, 10)), k=n+w); while(!ispseudoprime(k), k+=w); k\w}
{ for(n=1, 500, my(p=1<<prime(n)-1); if(ispseudoprime(p), print1(pfx(p), ", "))) } \\ Andrew Howroyd, Nov 17 2018
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Gilbert Mozzo, Mar 07 2012, Mar 18 2012
STATUS
approved