# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a304520 Showing 1-1 of 1 %I A304520 #21 May 24 2018 16:33:39 %S A304520 7,28,158,1087,8420,69034,586400,5097725,45088364,404211372, %T A304520 3663020374,33489909119,308457775318,2858876653517,26639629964435, %U A304520 249393774431034,2344318827962046,22116397163892861,209317713089716899,1986761935587919881,18906449884370307192 %N A304520 a(n) is the number of n-digit prime powers. %C A304520 "Prime powers" here are defined as in A246655, so 1 is not counted here as a prime power. %C A304520 For the number of n-digit primes, see A006879. %e A304520 a(1) = 7 because there are 7 1-digit numbers that are prime powers: 2=2^1, 3=3^1, 4=2^2, 5=5^1, 7=7^1, 8=2^3, and 9=3^2. %e A304520 a(2) = 28 because there are 28 2-digit prime powers: the 21 2-digit primes (11, 13, ..., 97), 2 squares of primes (25=5^2 and 49=7^2), 1 cube of a prime (27=3^3), 2 fourth powers of primes (16=2^4 and 81=3^4), 1 fifth power of a prime (32=2^5), and 1 sixth power of a prime (64=2^6). %t A304520 Prepend[Differences@ #, First@ #] &@ Array[Sum[PrimePi[10^(#/k)], {k, # Log2@ 10}] &, 12] (* _Michael De Vlieger_, May 20 2018, after _Robert G. Wilson v_ at A267712 *) %o A304520 (Magma) /* gives first 9 terms */ a:=[]; for n in [1..9] do tMin:=10^(n-1); tMax:=10^n-1; c:=0; for k in [1..Floor(Log(2,tMax))] do pMin:=Ceiling(tMin^(1/k)); pMax:=Floor(tMax^(1/k)); if pMin le pMax then c+:=#PrimesInInterval(pMin,pMax); end if; end for; a[n]:=c; end for; a; %Y A304520 Cf. A006879, A246655, A267712 (partial sums). %K A304520 nonn,base %O A304520 1,1 %A A304520 _Jon E. Schoenfield_, May 13 2018 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE