login
A284275
Number of primes between n and 2^n exclusive.
2
0, 1, 2, 4, 8, 15, 27, 50, 93, 168, 304, 559, 1022, 1894, 3506, 6536, 12244, 22993, 43382, 82017, 155603, 295939, 564154, 1077862, 2063680, 3957800, 7603544, 14630834, 28192740, 54400018, 105097554, 203280210, 393615795, 762939100, 1480206268, 2874398504
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
a(n) = A007053(n) - A000720(n), for n > 1. - Michel Marcus, Mar 26 2017
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