OFFSET
1,3
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..92 (calculated from the b-file at A007053; terms 1..47 from Vincenzo Librandi)
FORMULA
EXAMPLE
a(3) = 2 because there are 2 primes between 3 and 2^3: 5, 7 (we don't count the boundary of the interval in this case).
a(4) = 4 because there are 4 primes between 4 and 2^4: 5, 7, 11, 13.
MATHEMATICA
Join[{0}, Table[PrimePi[2^n] - PrimePi[n], {n, 2, 36}]] (* Improved by Alonso del Arte, Mar 26 2017 *)
PROG
(Magma) [0] cat [#PrimesInInterval(n+1, 2^n): n in [2..28]];
(PARI) a(n) = if (n==1, 0, primepi(2^n) - primepi(n)); \\ Michel Marcus, Mar 26 2017
(Python)
from sympy import primepi
def a(n): return primepi(2**n - 1) - primepi(n) # Indranil Ghosh, Mar 26 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Vincenzo Librandi, Mar 26 2017
STATUS
approved