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.

Previous Showing 21-30 of 233 results. Next

A073514 Number of primes less than 10^n with initial digit 4.

Original entry on oeis.org

0, 3, 20, 139, 1069, 8747, 74114, 641594, 5661135, 50653546, 458352691, 4185483176, 38510936699, 356622729564, 3320632228693, 31067060521057, 291869049531878, 2752144407792176, 26035873192178041, 247025281876786013, 2349914303292170310, 22407593754131275705
Offset: 1

Views

Author

Shyam Sunder Gupta, Aug 14 2002

Keywords

Examples

			a(2)=3 because there are 3 primes up to 10^2 whose initial digit is 4 (namely 41, 43 and 47).
		

Crossrefs

Cf. A073509 to A073517, their sum is A006880.
For primes with initial digit d (1 <= d <= 9) see A045707, A045708, A045709, A045710, A045711, A045712, A045713, A045714, A045715; A073517, A073516, A073515, A073514, A073513, A073512, A073511, A073510, A073509

Programs

  • Mathematica
    f[n_] := f[n] = PrimePi[5*10^n] - PrimePi[4*10^n] + f[n - 1]; f[0] = 0; Table[ f[n], {n, 0, 13}]

Extensions

Edited and extended by Robert G. Wilson v, Aug 29 2002
a(20)-a(22) added by David Baugh, Mar 22 2015

A073515 Number of primes less than 10^n with initial digit 3.

Original entry on oeis.org

1, 3, 19, 139, 1097, 8960, 75290, 651085, 5735086, 51247361, 463196868, 4225763390, 38851672813, 359541975662, 3345924530873, 31288310624754, 293820812588401, 2769490109678920, 26191046215879444, 248421640738371325, 2362546444095790527, 22522418647770393663
Offset: 1

Views

Author

Shyam Sunder Gupta, Aug 14 2002

Keywords

Examples

			a(2)=3 because there are 3 primes up to 10^2 whose initial digit is 3 (namely 3, 31 and 37).
		

Crossrefs

Cf. A073509 to A073517, their sum is A006880.
For primes with initial digit d (1 <= d <= 9) see A045707, A045708, A045709, A045710, A045711, A045712, A045713, A045714, A045715; A073517, A073516, A073515, A073514, A073513, A073512, A073511, A073510, A073509

Programs

  • Mathematica
    f[n_] := f[n] = PrimePi[4*10^n] - PrimePi[3*10^n] + f[n - 1]; f[0] = 1; Table[ f[n], {n, 0, 12}]

Extensions

Edited and extended by Robert G. Wilson v, Aug 29 2002
a(21)-a(22) added by David Baugh, Mar 22 2015

A073516 Number of primes less than 10^n with initial digit 2.

Original entry on oeis.org

1, 3, 19, 146, 1129, 9142, 77025, 664277, 5837665, 52064915, 469864125, 4281198201, 39319600765, 363545360347, 3380562309312, 31590949437540, 296487794277035, 2793170342851930, 26402713858800478, 250324979315879678, 2379753569255122805, 22678735843184786383
Offset: 1

Views

Author

Shyam Sunder Gupta, Aug 14 2002

Keywords

Examples

			a(2)=3 because there are 3 primes up to 10^2 whose initial digit is 2 (namely 2, 23 and 29).
		

Crossrefs

Cf. A073509 to A073517, their sum is A006880.
For primes with initial digit d (1 <= d <= 9) see A045707, A045708, A045709, A045710, A045711, A045712, A045713, A045714, A045715; A073517, A073516, A073515, A073514, A073513, A073512, A073511, A073510, A073509

Programs

  • Mathematica
    f[n_] := f[n] = PrimePi[3*10^n] - PrimePi[2*10^n] + f[n - 1]; f[0] = 1; Table[ f[n], {n, 0, 13}]

Extensions

Edited and extended by Robert G. Wilson v, Aug 29 2002
a(21)-a(22) added by David Baugh, Mar 21 2015

A145540 Number of numbers removed in each step of Eratosthenes's sieve for 10^4.

Original entry on oeis.org

4999, 1666, 666, 380, 207, 159, 110, 94, 76, 59, 56, 46, 41, 37, 33, 27, 23, 21, 17, 15, 12, 9, 8, 6, 3
Offset: 1

Views

Author

Artur Jasinski with assistance from Bob Hanlon (hanlonr(AT)cox.net), Oct 14 2008

Keywords

Comments

Number of steps in Eratosthenes's sieve for 10^n is A122121(n).
Number of primes less than 10^4 is 10^4 - (sum all of numbers in this sequence) - 1 = A006880(4).

Crossrefs

Programs

  • Maple
    A145540:=Array([seq(0,j=1..25)]): lim:=10^4: p:=Array([seq(ithprime(j),j=1..25)]): for n from 4 to lim do if(isprime(n))then n:=n+1: fi: for k from 1 to 25 do if(n mod p[k] = 0)then A145540[k]:=A145540[k]+1: break: fi: od: od: seq(A145540[j],j=1..25); # Nathaniel Johnston, Jun 23 2011
  • Mathematica
    f3[k_Integer?Positive, i_Integer?Positive] := Module[{f, m, r, p}, p = Transpose[{r = Range[2, i], Prime[r]}];f[x_] := Catch[Fold[If[Mod[x, #2[[2]]] == 0, Throw[m[ #2[[1]]] = m[ #2[[1]]] + 1], #1] &, If[Mod[x, 2] == 0, Throw[m[1] = m[1] + 1]], p]]; Table[m[n] = -1, {n, i}]; f /@ Range[k]; Table[m[n], {n, i}]];nn = 4; kk = PrimePi[Sqrt[10^nn]]; t3 = f3[10^nn, kk] (* Bob Hanlon (hanlonr(AT)cox.net) *)

A119290 a(n) is the total number of digits in the first 10^n primes.

Original entry on oeis.org

1, 16, 271, 3803, 48982, 610484, 7245905, 83484450, 942636916, 10487584405, 115369529592, 1257761617574, 13611696080735, 146406754329933, 1566562183907264, 16687323842873339, 177063766685219106, 1872323812397478246, 19738266145121133639, 207517446542560214799, 2176390177056541482871, 22774922890367225576581
Offset: 0

Views

Author

Enoch Haga, May 13 2006

Keywords

Examples

			At a(1) there are 10^1 primes, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, and the total number of digits is 16.
		

Crossrefs

Programs

  • Mathematica
    Accumulate@Table[c = 0; i0 = If[n == 0, 1, 10^(n - 1) + 1]; For[i = i0, i <= 10^n, i++, c += IntegerLength[Prime[i]]]; c, {n, 0, 6}] (* Robert Price, Jun 09 2019 *)

Formula

Count the digits in the first 10^n primes.
a(n) = sum while positive from k=0 to (10^n - A006880(k)). - Charles R Greathouse IV, Jul 09 2007

Extensions

Corrected and extended by Charles R Greathouse IV, Jul 09 2007

A122121 Number of primes <= 10^(n/2).

Original entry on oeis.org

0, 2, 4, 11, 25, 65, 168, 446, 1229, 3401, 9592, 27293, 78498, 227647, 664579, 1951957, 5761455, 17082666, 50847534, 151876932, 455052511, 1367199811, 4118054813, 12431880460, 37607912018, 113983535775, 346065536839, 1052370166553, 3204941750802, 9773865306521
Offset: 0

Views

Author

N. J. A. Sloane, based on a suggestion from Klaus Kastberg (Kastberg(AT)aapt.net.au), Oct 17 2006

Keywords

Examples

			a(3) = 11: sqrt(1000) = 31.62277660..., pi(31) = 11.
		

Crossrefs

Programs

  • Mathematica
    a={}; For[n=0, n<=27, n++, AppendTo[a,PrimePi[10^(n/2)]]]; Print[a]; (* John W. Layman, Mar 12 2010 *)
  • PARI
    { a= 0; n= 1; p=2 ; while(1, a++ ; pnext =nextprime(p+1) ; if( p^2 <= 10^n && pnext^2>10^n, print(a) ; n++ ; ) ; p=pnext ; ) ; } \\ R. J. Mathar, Jan 13 2007
    
  • Python
    from math import isqrt
    from sympy import primepi
    def A122121(n): return primepi(isqrt(10**n)) # Chai Wah Wu, Oct 17 2024

Formula

a(2n) = A006880(n). - R. J. Mathar, Jan 13 2007

Extensions

More terms from R. J. Mathar, Jan 13 2007
a(0)-a(17) confirmed, and a(18)-a(26) added using Mathematica, by John W. Layman, Mar 12 2010
a(27) and a(28) added using Mathematica, by David Baugh, Oct 06 2011
a(29) from Donovan Johnson, Mar 12 2013
a(30)-a(46) added using Kim Walisch's primecount program, by David Baugh, Feb 10 2015
a(47)-a(52) from David Baugh using Kim Walisch's primecount program, Jun 19 2016

A114106 Number of 4-almost primes less than or equal to 10^n.

Original entry on oeis.org

0, 0, 12, 149, 1712, 18744, 198062, 2050696, 20959322, 212385942, 2139236881, 21454599814, 214499908019, 2139634739326, 21306682904040, 211905511283590, 2105504493045818, 20905484578206982, 207458897819329031, 2057931819347474462
Offset: 0

Views

Author

Robert G. Wilson v, Feb 07 2006

Keywords

Examples

			There are 12 primes with four almost primes up to 100: 16, 24, 36, 40, 54, 56, 60, 81, 84, 88, 90 and 100, so a(2) = 12.
		

Crossrefs

Programs

  • Mathematica
    FourAlmostPrimePi[n_] := Sum[ PrimePi[n/(Prime@i*Prime@j*Prime@k)] - k + 1, {i, PrimePi[n^(1/4)]}, {j, i, PrimePi[(n/Prime@i)^(1/3)]}, {k, j, PrimePi@Sqrt[n/(Prime@i*Prime@j)]}]; Table[ FourAlmostPrimePi[n], {n, 0, 13}]
  • Python
    from math import isqrt
    from sympy import primepi, primerange, integer_nthroot
    def A114106(n): return sum(primepi(10**n//(k*m*r))-c for a,k in enumerate(primerange(integer_nthroot(10**n,4)[0]+1)) for b,m in enumerate(primerange(k,integer_nthroot(10**n//k,3)[0]+1),a) for c,r in enumerate(primerange(m,isqrt(10**n//(k*m))+1),b)) # Chai Wah Wu, Aug 17 2024

Extensions

a(14) from Robert G. Wilson v, Jan 07 2007
a(15)-a(17) from Henri Lifchitz, Jul 21 2015
a(18)-a(19) from Henri Lifchitz, Feb 02 2025

A116430 The number of n-almost primes less than or equal to 10^n, starting with a(0)=1.

Original entry on oeis.org

1, 4, 34, 247, 1712, 11185, 68963, 409849, 2367507, 13377156, 74342563, 407818620, 2214357712, 11926066887, 63809981451, 339576381990, 1799025041767, 9494920297227, 49950199374227, 262036734664892
Offset: 0

Views

Author

Robert G. Wilson v, Feb 10 2006, Jun 01 2006

Keywords

Comments

If instead we asked for those less than or equal to 2^n, then the sequence is A000012.

Crossrefs

Programs

  • Mathematica
    AlmostPrimePi[k_Integer, n_] := Module[{a, i}, a[0] = 1; If[k == 1, PrimePi[n], Sum[PrimePi[n/Times @@ Prime[Array[a, k - 1]]] - a[k - 1] + 1, Evaluate[ Sequence @@ Table[{a[i], a[i - 1], PrimePi[(n/Times @@ Prime[Array[a, i - 1]])^(1/(k - i + 1))]}, {i, k - 1}]]]]]; (* Eric W. Weisstein, Feb 07 2006 *)
    Table[ AlmostPrimePi[n, 10^n], {n, 0, 13}]
  • PARI
    almost_prime_count(N, k) = if(k==1, return(primepi(N))); (f(m, p, k, j=0) = my(c=0, s=sqrtnint(N\m, k)); if(k==2, forprime(q=p, s, c += primepi(N\(m*q))-j; j += 1), forprime(q=p, s, c += f(m*q, q, k-1, j); j += 1)); c); f(1, 2, k);
    a(n) = if(n == 0, 1, almost_prime_count(10^n, n)); \\ Daniel Suteu, Jul 10 2023
    
  • Python
    from math import prod, isqrt
    from sympy import primerange, integer_nthroot, primepi
    def A116430(n):
        if n<=1: return 3*n+1
        def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b,isqrt(x//c)+1),a)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b,integer_nthroot(x//c,m)[0]+1),a) for d in g(x,a2,b2,c*b2,m-1)))
        return int(sum(primepi(10**n//prod(c[1] for c in a))-a[-1][0] for a in g(10**n,0,1,1,n))) # Chai Wah Wu, Aug 23 2024

Extensions

Edited by N. J. A. Sloane, Aug 08 2008 at the suggestion of R. J. Mathar
a(15)-a(16) from Donovan Johnson, Oct 01 2010
a(17)-a(19) from Daniel Suteu, Jul 10 2023

A114453 Number of 5-almost primes less than or equal to 10^n.

Original entry on oeis.org

0, 0, 4, 76, 963, 11185, 124465, 1349779, 14371023, 150982388, 1570678136, 16218372618, 166497674684, 1701439985694, 17323079621014, 175846040834673, 1780617141307093, 17993699600756449, 181520864946969233
Offset: 0

Views

Author

Robert G. Wilson v, Feb 07 2006

Keywords

Examples

			There are 4 five-almost primes up to 100: 32,48,72 and 80, so a(2) = 4.
		

Crossrefs

Programs

  • Mathematica
    FiveAlmostPrimePi[n_] := Sum[ PrimePi[n/(Prime@i*Prime@j*Prime@k*Prime@l)] - l + 1, {i, PrimePi[n^(1/5)]}, {j, i, PrimePi[(n/Prime@i)^(1/4)]}, {k, j, PrimePi[(n/(Prime@i*Prime@j))^(1/3)]}, {l, k, PrimePi[(n/(Prime@i*Prime@j*Prime@k))^(1/2)]}]; Table[ FiveAlmostPrimePi[10^n], {n, 0, 12}]
  • Python
    from math import prod, isqrt
    from sympy import primerange, integer_nthroot, primepi
    def A114453(n):
        def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b,isqrt(x//c)+1),a)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b,integer_nthroot(x//c,m)[0]+1),a) for d in g(x,a2,b2,c*b2,m-1)))
        return int(sum(primepi(10**n//prod(c[1] for c in a))-a[-1][0] for a in g(10**n,0,1,1,5))) # Chai Wah Wu, Sep 18 2024

Extensions

a(13)-a(14) from Robert G. Wilson v, Jan 07 2007
a(15)-a(18) from Henri Lifchitz, Feb 03 2025

A097952 Sum of the number of digits in the prime numbers less than 10^n.

Original entry on oeis.org

0, 4, 46, 475, 4719, 46534, 459970, 4562537, 45337545, 451112256, 4493162026, 44786187348, 446664473808, 4456613596481, 44480880591963, 444075310669968, 4434375640450064, 44287795522995300, 442382943864554586
Offset: 0

Views

Author

Cino Hilliard, Sep 05 2004

Keywords

Comments

Partial sums of A046719(n) = n*A006879(n). In other words, a(n) is the number of digits used in writing out all {A006880(n)} primes below 10^n. - Lekraj Beedassy, Dec 13 2007

Examples

			There are 25 primes < 100; 4 of them are 1-digit numbers and 21 are 2-digit numbers. Thus a(2) = 4 + 21*2 = 46.
		

Crossrefs

Programs

  • Mathematica
    Accumulate[Table[n(PrimePi[10^n]-PrimePi[10^(n-1)]),{n,0,14}]] (* This generates the first 15 terms of the sequence, but if n exceeds 14 the function PrimePi in Mathematica cannot calculate it. *) (* Harvey P. Dale, Jun 13 2014 *)
  • PARI
    g(n) = for(j=0,n,s=0;forprime(x=2,10^j,y=length(Str(x));s+=y);print1(s","))

Formula

a(n) = Sum_{k=0..n} k * A006879(k). - Amiram Eldar, Jul 04 2024

Extensions

More terms derived from A006879 by R. J. Mathar, Oct 14 2010
Previous Showing 21-30 of 233 results. Next