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.

A209385 Values of the first prefixing digits for Mersenne primes.

This page as a plain text file.
%I A209385 #37 Dec 19 2018 23:19:00
%S A209385 1,1,1,4,1,10,1,36,15,58,57,55,310,177,51,2389,973,532,1750,63,1032,
%T A209385 1240,3757,9994,5854,12870,46147,11923,17113,10296,5977
%N A209385 Values of the first prefixing digits for Mersenne primes.
%H A209385 Henri Lifchitz and Renaud Lifchitz, <a href="http://www.primenumbers.net/prptop/prptop.php">PRP Top Records</a>
%e A209385 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.
%t A209385 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 *)
%o A209385 (PARI)
%o A209385 pfx(n)={my(w=10^(1+logint(n,10)), k=n+w); while(!ispseudoprime(k), k+=w); k\w}
%o A209385 { for(n=1, 500, my(p=1<<prime(n)-1); if(ispseudoprime(p), print1(pfx(p), ", "))) } \\ _Andrew Howroyd_, Nov 17 2018
%Y A209385 Cf. A000668 (Mersenne primes), A202136.
%K A209385 nonn,base,more
%O A209385 1,4
%A A209385 _Gilbert Mozzo_, Mar 07 2012, Mar 18 2012