A091641
Number of primes less than 10^n which do not contain the digit 7.
Original entry on oeis.org
3, 16, 100, 680, 4773, 34992, 266823, 2079512, 16503238, 132852644, 1081509855, 8885472675, 73563855306, 612982476612
Offset: 1
a(2) = 16 because of the 25 primes less than 10^2, 9 have at least one digit 7; 25-9=16.
-
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 *)
-
from sympy import primerange
def a(n): return sum('7' 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
A091642
Number of primes less than 10^n which do not contain the digit 8.
Original entry on oeis.org
4, 23, 141, 915, 6375, 46799, 355805, 2774348, 22023132, 177273427, 1443074791, 11855541525, 98146301284, 817786989282
Offset: 1
a(2) = 23 because of the 25 primes less than 10^2, 2 have at least one digit 8; 25-2 = 23.
-
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 *)
-
from sympy import sieve # use slower primerange for larger terms
def a(n): return sum('8' not 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
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
a(2) = 6 because of the 25 primes less than 10^2, 6 have at least one digit 9.
-
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 *)
A231726
Count of the first 10^n primes containing at least one 0's digit.
Original entry on oeis.org
0, 9, 181, 2878, 38298, 442776, 4937680, 54997237, 604120810, 6420599395, 67512632285
Offset: 1
a(2)=9 because there are 9 primes not greater than 547 (the 100th prime) that contain a zero digit. Namely: 101, 103, 107, 109, 307, 401, 409, 503, 509.
-
cnt = 0; Table[Do[p = Prime[k]; If[MemberQ[IntegerDigits[p], 0], cnt++], {k, 10^(n - 1) + 1, 10^n}]; cnt, {n, 5}] (* T. D. Noe, Nov 13 2013 *)
A231790
Count of the first 10^n primes containing at least one 4's digit.
Original entry on oeis.org
0, 25, 279, 3363, 39395, 485191, 5269618, 56745409, 607655311, 6578438247, 68950399755
Offset: 1
a(2)=25 because there are 25 primes not greater than 541 (the 100th prime) that contain a 4's digit. Namely: 41, 43, 47, 149, 241, 347, 349, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 541.
-
cnt = 0; Table[Do[p = Prime[k]; If[MemberQ[IntegerDigits[p], 4], cnt++], {k, 10^(n - 1) + 1, 10^n}]; cnt, {n, 5}] (* T. D. Noe, Nov 13 2013 *)
A231792
Count of the first 10^n primes containing at least one 5's digit.
Original entry on oeis.org
1, 15, 292, 3365, 39360, 464466, 5262871, 56702805, 607358478, 6463119473, 68932485429
Offset: 1
a(2)=15 because there are 15 primes not greater than 541 (the 100th prime) that contain a 5's digit. Namely: 5, 53 59, 151, 157, 251, 257, 353, 359, 457, 503, 509, 521, 523, 541.
-
cnt = 0; Table[Do[p = Prime[k]; If[MemberQ[IntegerDigits[p], 5], cnt++], {k, 10^(n - 1) + 1, 10^n}]; cnt, {n, 5}] (* T. D. Noe, Nov 13 2013 *)
A231796
Count of the first 10^n primes containing at least one 9's digit.
Original entry on oeis.org
2, 31, 380, 4990, 54268, 581858, 6214940, 67420394, 703398930, 7316745778, 75645891943
Offset: 1
a(2)=31 because there are 31 primes not greater than 541 (the 100th prime) that contain a 9's digit. Namely: 19, 29, 59, 79, 89, 97, 109, 139, 149, 179, 191, 193, 197, 199, 229, 239, 269, 293, 349, 359, 379, 389, 397, 409, 419, 439, 449, 479, 491, 499, 509.
-
cnt = 0; Table[Do[p = Prime[k]; If[MemberQ[IntegerDigits[p], 9], cnt++], {k, 10^(n - 1) + 1, 10^n}]; cnt, {n, 5}] (* T. D. Noe, Nov 13 2013 *)
A228414
Count of the first 10^n primes which do not contain the digit 2.
Original entry on oeis.org
0, 7, 77, 697, 6497, 55552, 512100, 4710641, 42205969, 341224891, 2787791578, 22971326749, 190650687957
Offset: 0
a(1) = 7 since there are 7 primes less than 29 (the 10th prime) that do not contain a 2. Namely: 3, 5, 7, 11, 13, 17, 19.
-
Table[Length[Select[Range[10^n], DigitCount[Prime[#], 10, 2] == 0 &]], {n, 0, 5}] (* Robert Price, Mar 23 2020 *)
A228415
Count of the first 10^n primes which do not contain the digit 3.
Original entry on oeis.org
1, 7, 54, 534, 4909, 45405, 385008, 3539880, 32260781, 294001190, 2564080248, 23271246324, 211753431947
Offset: 0
a(1) = 7 since there are 7 primes in the first 10 (through 29) that do not contain a 3. Namely: 2, 5, 7, 11, 17, 19, 29.
-
Table[Length[Select[Range[10^n], DigitCount[Prime[#], 10, 3] == 0 &]], {n, 0, 5}] (* Robert Price, Mar 23 2020 *)
A228416
Count of the first 10^n primes which do not contain the digit 4.
Original entry on oeis.org
1, 10, 75, 721, 6637, 60605, 514809, 4730382, 43254591, 392344689, 3421561753, 31049600245, 282499317912
Offset: 0
a(1) = 10 since there are 10 primes in the first 10 (through 29) that do not contain a 4. Namely: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29.
-
Table[Length[Select[Range[10^n], DigitCount[Prime[#], 10, 4] == 0 &]], {n, 0, 5}] (* Robert Price, Mar 23 2020 *)
Comments