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.

A332220 a(n) is the number of Mersenne exponents (terms of A000043) <= n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 09 2020

Keywords

Crossrefs

A left inverse of A000043, partial sums of A332219.

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));

Formula

a(1) = 0; and for n > 1, a(n) = A332219(n) + a(n-1).
For all n >= 1, a(A000043(n)) = n.