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 51-60 of 233 results. Next

A091709 Number of primes less than 10^n having at least one digit 8.

Original entry on oeis.org

0, 2, 27, 314, 3217, 31699, 308774, 2987107, 28824402, 277779084, 2674980022, 25752370493, 247919235555, 2387154761520
Offset: 1

Views

Author

Enoch Haga, Jan 30 2004

Keywords

Examples

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

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], 8] != {}, c++ ]]; Print[c]; p--, {n, 1, 8}] (* Robert G. Wilson v, Feb 02 2004 *)
  • Python
    from sympy import sieve # use slower primerange for larger terms
    def a(n): return sum('8' in str(p) for p in sieve.primerange(2, 10**n))
    print([a(n) for n in range(1, 8)]) # Michael S. Branicky, Apr 23 2021

Extensions

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

A091710 Number of primes less than 10^n having at least one digit 9.

Original entry on oeis.org

0, 6, 60, 542, 4826, 43359, 397093, 3677641, 34316162, 321993007, 3035059323, 28710966351, 272413818120, 2591276923548
Offset: 1

Views

Author

Enoch Haga, Jan 30 2004

Keywords

Examples

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

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], 9] != {}, c++ ]]; Print[c]; p--, {n, 1, 8}] (* Robert G. Wilson v, Feb 02 2004 *)

Extensions

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

A120048 Number of 7-almost primes less than or equal to 10^n.

Original entry on oeis.org

0, 0, 0, 14, 231, 2973, 35585, 409849, 4600247, 50678212, 550454756, 5913771637, 62981797962, 665997804082, 7001087934965, 73232029374751, 762783057783010, 7916319351632036, 81898808371556517
Offset: 0

Views

Author

Robert G. Wilson v, Feb 07 2006

Keywords

Examples

			There are 14 seven-almost primes up to 1000: 128, 192, 288, 320, 432, 448, 480, 648, 672, 704, 720, 800, 832 & 972.
		

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[7, 10^n], {n, 11}]

Extensions

More terms from Robert G. Wilson v, Jan 07 2007
Example corrected by Harvey P. Dale, Jan 25 2013
a(15)-a(18) from Henri Lifchitz, Mar 18 2025

A120050 Number of 9-almost primes less than or equal to 10^n.

Original entry on oeis.org

0, 0, 0, 2, 47, 671, 8491, 101787, 1180751, 13377156, 148930536, 1636170477, 17787688377, 191742524399, 2052389350029, 21838745177567, 231206458686127, 2437121982958248, 25591920108631224, 267840642082525459
Offset: 0

Views

Author

Robert G. Wilson v, Feb 07 2006

Keywords

Examples

			There are 2 nine-almost primes up to 1000: 512 & 768.
		

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[9, 10^n], {n, 12}]

Extensions

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

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

Original entry on oeis.org

0, 0, 0, 0, 22, 306, 4016, 49163, 578154, 6618221, 74342563, 823164388, 9011965866, 97765974368, 1052666075366, 11263041623194, 119864659464824, 1269754732725522, 13396817167474205, 140847445420555406
Offset: 0

Views

Author

Robert G. Wilson v, Feb 07 2006

Keywords

Examples

			There are 22 ten-almost primes up to 10000: 1024, 1536, 2304, 2560, 3456, 3584, 3840, 5184, 5376, 5632, 5760, 6400, 6656, 7776, 8064, 8448, 8640, 8704, 8960, 9600, 9728, and 9984.
		

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

Extensions

More terms from Robert G. Wilson v, Jan 07 2007
a(15)-a(19) from Henri Lifchitz, Mar 20 2025

A120053 Number of 12-almost primes less than or equal to 10^n.

Original entry on oeis.org

0, 0, 0, 0, 3, 63, 865, 11068, 133862, 1563465, 17836903, 200051717, 2214357712, 24255601105, 263439785143, 2841076717752, 30457549169277, 324855769153426, 3449587218984911, 36489283363168885
Offset: 0

Views

Author

Robert G. Wilson v, Feb 07 2006

Keywords

Examples

			There are 3 twelve-almost primes up to 10000: 4096, 6144, and 9216.
		

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

Extensions

a(13) and a(14) from Robert G. Wilson v, Jan 07 2007
a(15) from Chai Wah Wu, Aug 24 2024
a(16)-a(19) from Henri Lifchitz, Mar 18 2025

A190802 Gauss' approximation for the number of primes below 10^n.

Original entry on oeis.org

5, 29, 177, 1245, 9629, 78627, 664917, 5762208, 50849234, 455055614, 4118066400, 37607950280, 346065645809, 3204942065691, 29844571475287, 279238344248556, 2623557165610821, 24739954309690414, 234057667376222381, 2220819602783663483
Offset: 1

Views

Author

Nathaniel Johnston, May 25 2011

Keywords

Comments

The offset logarithmic integral or Eulerian logarithmic integral Li(10^n)-Li(2), i.e., integral(2..x, dt/log(t)), appears in Gauss’s formula for counting prime numbers < 10^n and is sometimes referred to as the "European" definition. - Vladimir Pletser, Mar 17 2013

References

  • Jonathan Borwein, David H. Bailey, "Mathematics by Experiment", A. K. Peters, 2004, p. 65 (Table 2.2).

Crossrefs

Programs

  • Maple
    seq(round(evalf(integrate(1/log(t),t=2..10^n))), n=1..21);
  • Mathematica
    Table[Round[Integrate[1/Log[t],{t,2,10^n}]],{n,20}] (* James C. McMahon, Feb 06 2024 *)

Formula

a(n) = round(integral(dt/log(t),t=2..10^n)).

A365474 a(n) = A365339(10^n).

Original entry on oeis.org

1, 7, 34, 193, 1276, 9656, 78562, 664643, 5761519, 50847598
Offset: 0

Views

Author

Chai Wah Wu, Sep 04 2023

Keywords

Comments

The Pollack et al. reference lists a(4)-a(7) and conjectures that A365339(n) = A000720(n)+64 for n >= 31957 which in turn implies the conjecture that a(n) = A006880(n)+64 for n >= 5.

Crossrefs

Programs

  • Python
    from bisect import bisect
    from sympy import totient
    def A365474(n):
        m = 10**n
        plist, qlist, c = tuple(totient(i) for i in range(1,m+1)), [0]*(m+1), 0
        for i in range(m):
            qlist[a:=bisect(qlist,plist[i],lo=1,hi=c+1,key=lambda x:plist[x])]=i
            c = max(c,a)
        return c

Formula

a(n) = A006880(n)+64 for n >= 5 (conjectured).

A040014 Number of primes < e^n.

Original entry on oeis.org

0, 1, 4, 8, 16, 34, 79, 183, 429, 1019, 2466, 6048, 14912, 37128, 93117, 234855, 595341, 1516233, 3877186, 9950346, 25614562, 66124777, 171141897, 443963543, 1154106844, 3005936865, 7842921261, 20496470801, 53645077679, 140599114669, 368973074565, 969455391690, 2550043255883
Offset: 0

Views

Author

Keywords

Comments

a(n) = A000720(A000149(n)). - Reinhard Zumkeller, Mar 17 2015

Crossrefs

Programs

  • Haskell
    a040014 = a000720 . a000149  -- Reinhard Zumkeller, Mar 17 2015
  • Mathematica
    Table[PrimePi[Exp[n]], {n, 0, 33}]

Extensions

a(27)-a(29) from Robert G. Wilson v, Jun 09 2000
a(30)-a(32) from Seiichi Manyama, May 04 2016

A073532 Number of n-digit primes with all digits distinct.

Original entry on oeis.org

4, 20, 97, 510, 2529, 10239, 33950, 90510, 145227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Zak Seidov, Aug 29 2002

Keywords

Comments

For any base b the number of distinct-digit primes is finite. For base 10, the maximal distinct-digit prime is 987654103; for any larger prime at least two digits coincide. The number of distinct-digit integers is also finite, see A073531.
No such primes exist with 10 or more distinct decimal digits, so a(n) = 0 for n >= 10. - Labos Elemer, Oct 25 2004; Robert G. Wilson v, Jul 25 2008

Examples

			a(3)=97 because there are 97 three-digit primes with distinct digits: 103, 107, 109, 127, 137, 139, 149, 157, 163, 167, 173, 179, 193, 197,239, 241, 251, 257, 263, 269, 271, 281, 283, 293,307, 317, 347, 349, 359, 367, 379, 389, 397, 401, 409, 419, 421, 431, 439, 457, 461, 463, 467, 479, 487, 491, 503, 509, 521, 523, 541, 547, 563, 569, 571, 587, 593, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 673, 683, 691, 701, 709, 719, 739, 743, 751, 761, 769, 809, 821, 823, 827, 829, 839, 853, 857, 859, 863, 907, 937, 941, 947, 953, 967, 971, 983.
		

Crossrefs

Programs

  • Mathematica
    lst = {}; Do[p = Prime@ n; If[ Union[Length /@ Split@ Sort@ IntegerDigits@ p] == {1}, AppendTo[lst, p]], {n, PrimePi[10^9]}]; Table[ Length@ Select[lst, 10^n < # < 10^(n + 1) &], {n, 0, 9}] (* Robert G. Wilson v, Jul 25 2008 *)
  • Python
    from itertools import permutations
    from sympy import isprime, primerange
    def distinct_digs(n): s = str(n); return len(s) == len(set(s))
    def a(n):
      if n >= 10: return 0
      return sum(isprime(int("".join(p))) for p in permutations("0123456789", n) if p[0] != '0')
    print([a(n) for n in range(1, 31)]) # Michael S. Branicky, Apr 20 2021

Extensions

Edited by N. J. A. Sloane, Aug 14 2007
Entries checked by Robert G. Wilson v, Jul 25 2008
Previous Showing 51-60 of 233 results. Next