A332220 a(n) is the number of Mersenne exponents (terms of A000043) <= n.
0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..44497
Programs
-
Mathematica
Accumulate@ Array[Boole@ PrimeQ[2^# - 1] &, 107] (* Michael De Vlieger, Feb 09 2020 *) With[{mpe=MersennePrimeExponent[Range[47]]},Accumulate[Table[If[ MemberQ[ mpe,n],1,0],{n,120}]]] (* Harvey P. Dale, Aug 22 2021 *)
-
PARI
A332219(n) = (isprime(n)&&isprime((2^n)-1)); A332220(n) = if(1==n,0,A332219(n)+A332220(n-1));