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-10 of 10 results.

A091634 Number of primes less than 10^n which do not contain the digit 0.

Original entry on oeis.org

4, 25, 153, 1010, 7122, 52313, 397866, 3103348, 24649318, 198536215, 1616808581, 13287264748, 110033428309, 917072930187
Offset: 1

Views

Author

Enoch Haga, Jan 30 2004

Keywords

Examples

			a(3) = 153 because there are 168 primes less than 10^3, 15 primes have at least one zero; 168 - 15 = 153.
		

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], 0] == {}, c++ ]]; Print[c]; p--, {n, 1, 8}] (* Robert G. Wilson v, Feb 02 2004 *)
    Table[PrimePi[10^n]-Total[Boole[DigitCount[#,10,0]>0]&/@ Prime[ Range[ PrimePi[ 10^n]]]],{n,8}] (* The program generates the first 8 terms of the sequence. To generate more, increase the digit 8 but the program may take a long time to run. *) (* Harvey P. Dale, Aug 26 2021 *)
  • Python
    from sympy import sieve # use primerange for larger terms
    def nodigs0(n): return '0' not in str(n)
    def aupton(terms):
      ps, alst = 0, []
      for n in range(1, terms+1):
        ps += sum(nodigs0(p) for p in sieve.primerange(10**(n-1), 10**n))
        alst.append(ps)
      return alst
    print(aupton(7)) # Michael S. Branicky, Apr 25 2021

Formula

Number of primes less than 10^n after removing any primes with at least one digit 0.
a(n) <= A052386(n) = 9*(9^n-1)/8. - Charles R Greathouse IV, Sep 13 2016
a(n) <= (9^n-1)/2 = A052386(n)*4/9 since the last digit of a prime of n digits can only be one of 4 numbers, (2,3,5,7) when n = 1 and (1,3,7,9) when n > 1. - Chai Wah Wu, Mar 18 2018

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

A091646 Number of primes less than 10^n having at least one digit 2.

Original entry on oeis.org

1, 3, 29, 352, 3357, 32393, 312424, 3014171, 29016211, 279171099, 2685272908, 25829666453, 248507003625, 2391688694305
Offset: 1

Views

Author

Enoch Haga, Jan 30 2004

Keywords

Examples

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

Crossrefs

Extensions

Edited 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

A091647 Number of primes less than 10^n having at least one digit 3.

Original entry on oeis.org

1, 9, 66, 561, 4877, 43685, 399564, 3694303, 34433999, 322852288, 3041362298, 28758431735, 272777483044, 2594081699837
Offset: 1

Views

Author

Enoch Haga, Jan 30 2004

Keywords

Examples

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

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

Extensions

Edited 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

A091707 Number of primes less than 10^n having at least one digit 6.

Original entry on oeis.org

0, 2, 32, 332, 3225, 31792, 309431, 2991216, 28863327, 278085918, 2677289604, 25769815303, 248050788931, 2388172543971
Offset: 1

Views

Author

Enoch Haga, Jan 30 2004

Keywords

Examples

			a(1) = 0 because of the 4 primes less than 10^1, none have at least one digit 6.
		

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], 6] != {}, 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('6' 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 21 2005
a(13) from Robert Price, Nov 11 2013
a(14) from Giovanni Resta, Jul 21 2015

A091708 Number of primes less than 10^n having at least one digit 7.

Original entry on oeis.org

1, 9, 68, 549, 4819, 43506, 397756, 3681943, 34344296, 322199867, 3036544958, 28722439343, 272501681533, 2591959274190
Offset: 1

Views

Author

Enoch Haga, Jan 30 2004

Keywords

Examples

			a(1) = 1 because of the 4 primes less than 10^1, 1 has at least one digit 7.
		

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], 7] != {}, c++ ]]; Print[c]; p--, {n, 1, 8}] (* Robert G. Wilson v, Feb 02 2004 *)
    Table[Count[Prime[Range[PrimePi[10^n]]],?(DigitCount[#,10,7]>0&)],{n,12}] (* _Harvey P. Dale, Mar 03 2013 *)

Extensions

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

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

A091705 Number of primes less than 10^n having at least one digit 4.

Original entry on oeis.org

0, 3, 32, 326, 3231, 31953, 310456, 3000349, 28922364, 278508004, 2680391313, 25793058269, 248228108241, 2389543008906
Offset: 1

Views

Author

Enoch Haga, Jan 30 2004

Keywords

Examples

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

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], 4] != {}, 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 21 2005
a(13) from Robert Price, Nov 11 2013
a(14) from Giovanni Resta, Jul 21 2015

A091706 Number of primes less than 10^n having at least one digit 5.

Original entry on oeis.org

1, 3, 32, 324, 3282, 31949, 309669, 2995706, 28891689, 278270868, 2678674624, 25780340194, 248131741834, 2388797604792
Offset: 1

Views

Author

Enoch Haga, Jan 30 2004

Keywords

Examples

			a(1) = 1 because of the 4 primes less than 10^1, 1 has at least one digit 5.
		

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], 5] != {}, c++ ]]; Print[c]; p--, {n, 1, 8}] (* Robert G. Wilson v, Feb 02 2004 *)
    Table[Count[Prime[Range[PrimePi[10^n]]],?(DigitCount[#,10,5]>0&)],{n,8}] (* _Harvey P. Dale, Dec 29 2012 *)

Extensions

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

A373294 a(n) is the number of n-digit primes that have at least one zero among their digits (A056709).

Original entry on oeis.org

0, 0, 15, 204, 2251, 23715, 240528, 2391394, 23540109, 230318080, 2244729936, 21819401038, 211711461260, 2051836712085
Offset: 1

Views

Author

Gonzalo Martínez, May 30 2024

Keywords

Examples

			For n = 3, the 3-digit prime numbers that have the digit 0 are 101, 103, 107, 109, 307, 401, 409, 503, 509, 601, 607, 701, 709, 809 and 907. Therefore, a(3) = 15.
		

Crossrefs

First differences of A091644.

Programs

  • PARI
    a(n) = my(s=0); forprime(p=10^(n-1), 10^n-1, if (vecmin(digits(p)) == 0, s++)); s; \\ Michel Marcus, May 31 2024

Formula

a(n) = A091644(n) - A091644(n-1) for n > 1. - Michael S. Branicky, May 31 2024

Extensions

More terms (using A091644) from Michael S. Branicky, May 30 2024
Showing 1-10 of 10 results.