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 31-40 of 233 results. Next

A055729 Number of primes <= 3^n.

Original entry on oeis.org

0, 2, 4, 9, 22, 53, 129, 327, 847, 2227, 5968, 16097, 43934, 120739, 334349, 931260, 2607165, 7332159, 20700806, 58648288, 166677978, 475023803, 1357200840, 3886548158, 11152818693, 32064929886, 92349038518, 266398236486, 769616513836, 2226457080707, 6449247674296, 18703411700669, 54301968156067, 157820174545456
Offset: 0

Views

Author

Robert G. Wilson v, Jun 09 2000

Keywords

Crossrefs

Cf. A006880 and A007053.

Programs

  • Mathematica
    Table[PrimePi[3^n], {n, 0, 29}]
  • PARI
    a(n) = primepi(3^n); \\ Michel Marcus, Aug 25 2014

Formula

a(n) = A000720(A000244(n)). - Michel Marcus, Aug 25 2014

Extensions

a(28)-a(40) from Henri Lifchitz, Nov 11 2012

A057794 (Integer nearest R(10^n)) - pi(10^n), where pi(x) is the number of primes <= x, R(x) = Sum_{ k>=1 } (mu(k)/k * li(x^(1/k))) and li(x) is the Cauchy principal value of the integral from 0 to x of dt/log(t).

Original entry on oeis.org

1, 1, 0, -2, -5, 29, 88, 97, -79, -1828, -2318, -1476, -5773, -19200, 73218, 327052, -598255, -3501366, 23884333, -4891825, -86432204, -127132665, 1033299853, -1658989719, -1834784714, -17149335456, -17535487934, -174760519827
Offset: 1

Views

Author

Robert G. Wilson v, Nov 04 2000

Keywords

Comments

This is Riemann's remarkable approximation for the number of primes <= x.
Equivalently, R(x) is given by the Gram series, 1 + sum of log(x)^k/(k*k!*zeta(k+1)) for k = 1 to infinity. This series converges more quickly.

References

  • John H. Conway and R. K. Guy, "The Book of Numbers," Copernicus, an imprint of Springer-Verlag, NY, 1996, page 146.
  • M. du Sautoy, The Music of the Primes, Fourth Estate / HarperCollins, 2003; see p. 90.

Crossrefs

Programs

  • Mathematica
    R[x_] := Sum[N[LogIntegral[x^(1/k)]*MoebiusMu[k]/k, 36], {k, 1, 1000}]; a[n_] := Abs[Round[R[10^n]-PrimePi[10^n]]]
    gram[x_] := 1+Sum[N[Log[x]^k/(k*k!*Zeta[k+1]), 100], {k, 1, 1000}]; a[n_] := Abs[Round[gram[10^n]-PrimePi[10^n]]]
    (* From version 7 on : *) a[n_] := Round[RiemannR[10^n]-PrimePi[10^n]] (* Jean-François Alcover, Sep 17 2012 *)
  • PARI
    A057794=vector(#A006880,i,round(1+suminf(k=1, log(10^i)^k/(k*k!*zeta(k+1)))-A006880[i])) \\ - M. F. Hasler, Feb 26 2008

Extensions

First term corrected by David Baugh, Nov 15 2002
Signs added by M. F. Hasler, Feb 26 2008
The value of a(23) is not known at present, I believe. - N. J. A. Sloane, Mar 17 2008
Last two terms a(23) and a(24), with Pi(10^n) for n=23 and 24 from A006880, from Vladimir Pletser, Feb 27 2013
Terms a(25)-a(28) obtained using A006880. - Eduard Roure Perdices, Apr 13 2021

A120049 Number of 8-almost primes less than or equal to 10^n.

Original entry on oeis.org

0, 0, 0, 7, 105, 1418, 17572, 207207, 2367507, 26483012, 291646797, 3173159326, 34192782745, 365561221293, 3882841742380, 41015564702074, 431227959019552, 4515480975731045, 47115876816676830
Offset: 0

Views

Author

Robert G. Wilson v, Feb 07 2006

Keywords

Examples

			There are 7 eight-almost primes up to 1000: 256, 384, 576, 640, 864, 896 & 960.
		

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[8, 10^n], {n, 12}]
  • Python
    from math import prod, isqrt
    from sympy import primerange, integer_nthroot, primepi
    def A120049(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,8))) # Chai Wah Wu, Aug 23 2024

Extensions

a(13)-a(14) from Robert G. Wilson v, Jan 07 2007
Example corrected by Harvey P. Dale, Aug 13 2018
a(15)-a(18) from Henri Lifchitz, Mar 18 2025

A091645 Number of primes less than 10^n having at least one digit 1.

Original entry on oeis.org

0, 8, 67, 559, 4917, 44073, 402030, 3709989, 34534791, 323587790, 3046685950, 28798331502, 273078628285, 2596399340798
Offset: 1

Views

Author

Enoch Haga, Jan 30 2004

Keywords

Examples

			a(2) = 8 because of the 25 primes less than 10^2, 8 have at least one 1 digit.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; c = 0; p = 1; Do[ While[ p = NextPrim[p]; p < 10^n, If[ Position[ IntegerDigits[p], 1] != {}, c++ ]]; Print[c]; p--, {n, 1, 8}] (* Robert G. Wilson v, Feb 02 2004 *)
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; c = 0; p = 1; Do[ While[ p = NextPrim[p]; p < 10^n, If[ Position[ IntegerDigits[p], 2] != {}, c++ ]]; Print[c]; p--, {n, 1, 8}] (* Robert G. Wilson v, Feb 02 2004 *)

Extensions

Edited, corrected and extended by Robert G. Wilson v, Feb 02 2004
3 more terms from Ryan Propper, Aug 20 2005
a(13) from Robert Price, Nov 11 2013
a(14) from Giovanni Resta, Jul 21 2015

A120047 Number of 6-almost primes less than or equal to 10^n.

Original entry on oeis.org

0, 0, 2, 37, 485, 5933, 68963, 774078, 8493366, 91683887, 977694273, 10327249593, 108264085934, 1128049914377, 11694704489580, 120734708167792, 1242063105505230, 12739510126065301, 130330025583399801
Offset: 0

Views

Author

Robert G. Wilson v, Feb 07 2006

Keywords

Examples

			There are 2 six-almost primes up to 100: 64 and 96, so a(2) = 2.
		

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[6, 10^n], {n, 0, 13}]
  • Python
    from math import isqrt, prod
    from sympy import primerange, integer_nthroot, primepi
    def almostprimepi(n,k):
        if k==0: return int(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(n//prod(c[1] for c in a))-a[-1][0] for a in g(n,0,1,1,k)) if k>1 else primepi(n))
    def A120047(n): return almostprimepi(10**n,6) # Chai Wah Wu, Dec 09 2024

Extensions

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

A145583 a(n) = number of numbers removed in the n-th step of Eratosthenes's sieve for 10^2.

Original entry on oeis.org

49, 16, 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^2 is equal to 10^2 - (sum all of numbers in this sequence) - 1 = A006880(2).

Crossrefs

Programs

  • 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 = 2; kk = PrimePi[Sqrt[10^nn]]; t3 = f3[10^nn, kk] (*Bob Hanlon (hanlonr(AT)cox.net) *)

A145592 a(n)=number of numbers removed in each step of Eratosthenes's sieve for 2^14.

Original entry on oeis.org

8191, 2730, 1091, 623, 340, 260, 182, 154, 121, 94, 89, 74, 66, 62, 55, 48, 43, 39, 35, 31, 28, 25, 23, 19, 15, 12, 11, 9, 7, 5, 1
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 2^n is A060967(n).
Number of primes less than 2^14 is equal to 2^14 - (sum all of numbers in this sequence) - 1 = A007053(14).

Crossrefs

Programs

  • 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 = 14; kk = PrimePi[Sqrt[2^nn]]; t3 = f3[2^nn, kk] (* Bob Hanlon (hanlonr(AT)cox.net) *)

A091635 Number of primes less than 10^n which do not contain the digit 1.

Original entry on oeis.org

4, 17, 101, 670, 4675, 34425, 262549, 2051466, 16312743, 131464721, 1071368863, 8809580516, 72986908554, 608542410004
Offset: 1

Views

Author

Enoch Haga, Jan 30 2004

Keywords

Examples

			a(2) = 17 because of the 25 primes less than 10^2, 8 have at least one digit 1; 25-8 = 17.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; c = 0; p = 1; Do[ While[ p = NextPrim[p]; p < 10^n, If[ Position[ IntegerDigits[p], 1] == {}, c++ ]]; Print[c]; p--, {n, 1, 8}] (* Robert G. Wilson v, Feb 02 2004 *)
  • Python
    from sympy import sieve # import/use primerange for larger terms
    def a(n): return sum('1' not in str(p) for p in sieve.primerange(1, 10**n))
    print([a(n) for n in range(1, 8)]) # Michael S. Branicky, Apr 17 2021

Formula

Number of primes less than 10^n after removing any primes with at least one digit 1.
a(n) = A006880(n) - A091645(n).

Extensions

Edited and extended by Robert G. Wilson v, Feb 02 2004
a(9)-a(12) from Donovan Johnson, Feb 14 2008
a(13) from Robert Price, Nov 08 2013
a(14) from Giovanni Resta, Mar 20 2017

A091636 Number of primes less than 10^n which do not contain the digit 2.

Original entry on oeis.org

3, 22, 139, 877, 6235, 46105, 352155, 2747284, 21831323, 175881412, 1432781905, 11778245565, 97558533214, 813253056497
Offset: 1

Views

Author

Enoch Haga, Jan 30 2004

Keywords

Comments

Number of primes less than 10^n after removing any primes with at least one digit 2.

Examples

			a(2) = 22 because of the 25 primes less than 10^2, 3 have at least one digit 2. 25-3 = 22.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; c = 0; p = 1; Do[ While[ p = NextPrim[p]; p < 10^n, If[ Position[ IntegerDigits[p], 2] == {}, c++ ]]; Print[c]; p--, {n, 1, 8}] (* Robert G. Wilson v, Feb 02 2004 *)
  • Python
    from sympy import primerange
    def a(n): return sum('2' not in str(p) for p in primerange(2, 10**n))
    print([a(n) for n in range(1, 7)]) # Michael S. Branicky, Mar 22 2021

Formula

a(n) = A006880(n) - A091646(n).

Extensions

Edited and extended by Robert G. Wilson v, Feb 02 2004
a(9)-a(12) from Donovan Johnson, Feb 14 2008
a(13) from Robert Price, Nov 08 2013
a(14) from Giovanni Resta, Mar 20 2017

A091637 Number of primes less than 10^n which do not contain the digit 3.

Original entry on oeis.org

3, 16, 102, 668, 4715, 34813, 265015, 2067152, 16413535, 132200223, 1076692515, 8849480283, 73288053795, 610860050965
Offset: 1

Views

Author

Enoch Haga, Jan 30 2004

Keywords

Comments

Number of primes less than 10^n after removing any primes with at least one digit 3.

Examples

			a(2)=16 because there are 25 primes less than 10^2, 9 have at least one digit 3; 25-9 = 16.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; c = 0; p = 1; Do[ While[ p = NextPrim[p]; p < 10^n, If[ Position[ IntegerDigits[p], 3] == {}, c++ ]]; Print[c]; p--, {n, 1, 8}] (* Robert G. Wilson v, Feb 02 2004 *)
    Table[Count[Prime[Range[PrimePi[10^n]]],?(DigitCount[#,10,3]==0&)],{n,8}] (* _Harvey P. Dale, Oct 04 2011 *)
  • PARI
    good(n)=n=eval(Vec(Str(n)));for(i=1,#n,if(n[i]==3,return(1)));0
    a(n)=my(s);forprime(p=2,10^n,s+=good(p));s \\ Charles R Greathouse IV, Oct 04 2011
    
  • Python
    from sympy import primerange
    def a(n): return sum('3' not in str(p) for p in primerange(2, 10**n))
    print([a(n) for n in range(1, 7)]) # Michael S. Branicky, Mar 16 2021

Formula

a(n) = A006880(n) - A091647(n).

Extensions

Edited and extended by Robert G. Wilson v, Feb 02 2004
a(9)-a(12) from Donovan Johnson, Feb 14 2008
a(13) from Robert Price, Nov 08 2013
a(14) from Giovanni Resta, Mar 20 2017
Previous Showing 31-40 of 233 results. Next