A266143 Number of n-digit primes in which n-1 of the digits are 4's.
4, 3, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1
Examples
a(3) = 2 since 443 and 449 are primes. a(4) = 2 since 4441 and 4447 are primes.
Links
- Michael De Vlieger and Robert G. Wilson v, Table of n, a(n) for n = 1..1500
Crossrefs
Programs
-
Mathematica
d = 4; Array[Length@ Select[d (10^# - 1)/9 + (Range[0, 9] - d), PrimeQ] &, 100]
-
Python
from _future_ import division from sympy import isprime def A266143(n): return 4 if n==1 else sum(1 for d in [-3,-1,3,5] if isprime(4*(10**n-1)//9+d)) # Chai Wah Wu, Dec 27 2015
Comments