|
|
A228421
|
|
Count of the first 10^n primes which do not contain the digit 9.
|
|
20
|
|
|
1, 8, 69, 620, 5010, 45732, 418142, 3785060, 32579606, 296601070, 2683254222, 24354108057, 212324183352
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(1) = 8 since there are 8 primes in the first 10 (through 29) that do not contain a 9. Namely: 2, 3, 5, 7, 11, 13, 17, 23.
|
|
MATHEMATICA
|
Table[Length[Select[Range[10^n], DigitCount[Prime[#], 10, 9] == 0 &]], {n, 0, 5}] (* Robert Price, Mar 23 2020 *)
|
|
PROG
|
(Python)
def a(n):
count = 0
for k in range(1, 10**n+1):
if '9' not in str(prime(k)):
count += 1
return count
n = 0
while n < 10:
print(a(n), end=', ')
n += 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
more,nonn,base,hard
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|