|
|
A209385
|
|
Values of the first prefixing digits for Mersenne primes.
|
|
1
|
|
|
1, 1, 1, 4, 1, 10, 1, 36, 15, 58, 57, 55, 310, 177, 51, 2389, 973, 532, 1750, 63, 1032, 1240, 3757, 9994, 5854, 12870, 46147, 11923, 17113, 10296, 5977
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
LINKS
|
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|