login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A091644 Number of primes less than 10^n which have at least one digit 0. 9

%I #22 Apr 25 2021 12:19:22

%S 0,0,15,219,2470,26185,266713,2658107,26198216,256516296,2501246232,

%T 24320647270,236032108530,2287868820615

%N Number of primes less than 10^n which have at least one digit 0.

%C 3 additional terms, generated using a sieve program. - _Ryan Propper_, Aug 20 2005

%F a(n) = A006880(n) - A091634(n).

%e a(3) = 15 because of the 168 primes less than 10^3, 15 have at least one 0 digit.

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

%o (Python)

%o from sympy import sieve # use primerange for larger terms

%o def digs0(n): return '0' in str(n)

%o def aupton(terms):

%o ps, alst = 0, []

%o for n in range(1, terms+1):

%o ps += sum(digs0(p) for p in sieve.primerange(10**(n-1), 10**n))

%o alst.append(ps)

%o return alst

%o print(aupton(7)) # _Michael S. Branicky_, Apr 25 2021

%Y Cf. A091645, A091646, A091647, A091705, A091706, A091707, A091708, A091709, A091710.

%K nonn,base,more

%O 1,3

%A _Enoch Haga_, Jan 30 2004

%E Edited and extended by _Robert G. Wilson v_, Feb 02 2004

%E More terms from _Ryan Propper_, Aug 20 2005

%E a(13) from _Robert Price_, Nov 11 2013

%E a(14) from _Giovanni Resta_, Jul 21 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 07:08 EDT 2024. Contains 371698 sequences. (Running on oeis4.)