A085501 Number of prime powers p^k <= n that are not prime (k = 0 or k > 1).
1, 1, 1, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 7, 7, 7, 7, 7, 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, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11
Offset: 1
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Prime Power.
- Eric Weisstein's World of Mathematics, Perfect Powers.
Programs
-
PARI
a(n)=sum(k=2,logint(n,2), primepi(sqrtnint(n,k)))+1 \\ Charles R Greathouse IV, Jul 21 2017
-
PARI
first(n)=my(v=vector(n),s=1); for(e=2,logint(n,2), forprime(p=2,sqrtnint(n,e), v[p^e]=1)); for(i=1,n, s+=v[i]; v[i]=s); v \\ Charles R Greathouse IV, Jul 21 2017
-
Python
from sympy import primepi, integer_nthroot def A085501(n): return 1+sum(primepi(integer_nthroot(n,k)[0]) for k in range(2,n.bit_length())) # Chai Wah Wu, Aug 15 2024
Comments