OFFSET
1,2
COMMENTS
Prime powers are defined as numbers of the form p^k with p prime and k >= 1 (A246655).
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..92
EXAMPLE
a(1)=1 because the interval [2,2] contains 1 prime power: 2.
a(2)=2 because the interval [3,4] contains 2 prime powers: 3 and 4=2^2.
a(3)=3 because the prime powers in [5,8] are 5, 7, and 8=2^3.
PROG
(PARI) a(n) = sum(k=2^(n-1)+1, 2^n, isprimepower(k) != 0); \\ Michel Marcus, May 17 2018
(Python)
from sympy import primepi, integer_nthroot
def A304521(n):
def f(x):
m = 1<<x
return int(sum(primepi(integer_nthroot(m, k)[0]) for k in range(1, x+1)))
return f(n)-f(n-1) # Chai Wah Wu, Jan 19 2025
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Jon E. Schoenfield, May 13 2018
STATUS
approved