cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A238815 Number of prime powers p^k (k >= 0) (A000961) <= 10^n.

Original entry on oeis.org

1, 8, 36, 194, 1281, 9701, 78735, 665135, 5762860, 50851224, 455062596, 4118082970, 37607992089, 346065767407, 3204942420924, 29844572385359, 279238346816393, 2623557174778439, 24739954338671300, 234057667428388199, 2220819603016308080, 21127269487386615272
Offset: 0

Views

Author

Robert G. Wilson v, Mar 05 2014

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = t = 1}, While[s = PrimePi[ 10^(n/k)]; s != 0, t = t + s; k++]; t]; Array[f, 15, 0]
  • PARI
    a(n)=sum(k=2,10^n,isprimepower(k)>0)+1 \\ Charles R Greathouse IV, Mar 05 2014
    
  • PARI
    a(n)=sum(e=1,n*log(10)\log(2),primepi(sqrtnint(10^n,e)))+1 \\ Charles R Greathouse IV, Mar 05 2014

Formula

a(n) = A076048(n) + A006880(n).
a(n) ~ 10^n/(n log 10). - Charles R Greathouse IV, Mar 05 2014
For n > 0, a(n) = A267712(n) + 1. - Jon E. Schoenfield, Apr 19 2018

Extensions

a(15)-a(21) from Charles R Greathouse IV, Mar 05 2014

A304520 a(n) is the number of n-digit prime powers.

Original entry on oeis.org

7, 28, 158, 1087, 8420, 69034, 586400, 5097725, 45088364, 404211372, 3663020374, 33489909119, 308457775318, 2858876653517, 26639629964435, 249393774431034, 2344318827962046, 22116397163892861, 209317713089716899, 1986761935587919881, 18906449884370307192
Offset: 1

Views

Author

Jon E. Schoenfield, May 13 2018

Keywords

Comments

"Prime powers" here are defined as in A246655, so 1 is not counted here as a prime power.
For the number of n-digit primes, see A006879.

Examples

			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.
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).
		

Crossrefs

Cf. A006879, A246655, A267712 (partial sums).

Programs

  • 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;
  • Mathematica
    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 *)
Showing 1-2 of 2 results.