OFFSET
0,2
COMMENTS
Number of prime powers <= 2^n. - Jon E. Schoenfield, Nov 06 2016
LINKS
Ray Chandler, Table of n, a(n) for n = 0..92 (using b-file from A007053, first 61 terms from Hiroaki Yamanouchi)
FORMULA
From Ridouane Oudra, Oct 26 2020: (Start)
a(n) = 1 + Sum_{i=1..n} pi(floor(2^(n/i))), where pi(n) = A000720(n);
a(n) = 1 + A182908(n). (End)
a(n) = A025528(2^n)+1. - Pontus von Brömssen, Sep 28 2024
MATHEMATICA
{1}~Join~Flatten[1 + Position[Select[Range[10^6], PrimePowerQ], k_ /; IntegerQ@ Log2@ k ]] (* Michael De Vlieger, Nov 14 2016 *)
PROG
(PARI) lista(nn) = {v = vector(2^nn, i, i); vpp = select(x->ispp(x), v); print1(1, ", "); for (i=1, #vpp, if ((vpp[i] % 2) == 0, print1(i, ", ")); ); } \\ Michel Marcus, Nov 17 2014
(PARI) a(n)=sum(k=1, n, primepi(sqrtnint(2^n, k)))+1 \\ Charles R Greathouse IV, Nov 21 2014
(PARI) a(n)=my(s=0); for(i=1, 2^n, isprimepower(i) && s++); s+1 \\ Dana Jacobsen, Mar 23 2021
(SageMath) def a(n): return sum(prime_pi(ZZ(2^n).nth_root(k+1, truncate_mode=1)[0]) for k in range(n))+1 # Dana Jacobsen, Mar 23 2021
(Perl) use ntheory ":all"; for my $n (0..20) { my $s=1; is_prime_power($_) && $s++ for 1..2**$n; print "$n $s\n" } # Dana Jacobsen, Mar 23 2021
(Perl) use ntheory ":all"; for my $n (0..64) { my $s = ($n < 1) ? 1 : vecsum(map{prime_count(rootint(powint(2, $n)-1, $_))}1..$n)+2; print "$n $s\n"; } # Dana Jacobsen, Mar 23 2021
(Perl) # with b-file for pi(2^n)
perl -Mntheory=:all -nE 'my($n, $pc)=split; say "$n ", addint($pc, vecsum( map{prime_count(rootint(powint(2, $n), $_))} 2..$n )+1); ' b007053.txt # Dana Jacobsen, Mar 23 2021
(Python)
from sympy import primepi, integer_nthroot
def A024622(n):
x = 1<<n
return int(1+sum(primepi(integer_nthroot(x, k)[0]) for k in range(1, n+1))) # Chai Wah Wu, Nov 05 2024
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
EXTENSIONS
a(28)-a(36) from Hiroaki Yamanouchi, Nov 21 2014
a(46)-a(53) corrected by Hiroaki Yamanouchi, Nov 15 2016
STATUS
approved