OFFSET
0,2
EXAMPLE
When n = 1, there are four primes less than 10: 2, 3, 5, and 7. None of these have 1 as a digit so a(1) = 4.
MATHEMATICA
f[n_] := Block[{i}, Flatten@ Map[Length, Last@ Reap@ For[i = 0, i <= n, i++, Sow@ Select[Range[10^i], PrimeQ@ # && DigitCount[#][[i]] == 0 &]], {2}]]; f@ 7 (* Michael De Vlieger, Mar 26 2015 *)
PROG
(Sage) [len([p for p in prime_range(10^n) if not(str(n) in str(p))]) for n in [1..9]] # Tom Edgar, Feb 17 2015
(Python)
from sympy import primerange
def a(n):
target = str(n)
return sum(1 for p in primerange(1, 10**n) if target not in str(p))
print([a(n) for n in range(7)]) # Michael S. Branicky, Oct 30 2022
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Asa Kaplan, Feb 09 2015
EXTENSIONS
a(7)-a(9) from Tom Edgar, Feb 17 2015
a(10) from Michael S. Branicky, Oct 30 2022
a(11) from Michael S. Branicky, Jun 01 2023
a(12) from Michael S. Branicky, Jul 06 2023
STATUS
approved