
EXAMPLE

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.


MATHEMATICA

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