login
A266145
Number of n-digit primes in which n-1 of the digits are 6's.
9
4, 2, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 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, 0
OFFSET
1,1
COMMENTS
The leading digits must be 6's and only the trailing digit can vary.
For n large a(n) is usually zero.
LINKS
Michael De Vlieger and Robert G. Wilson v, Table of n, a(n) for n = 1..1500
EXAMPLE
a(2) = 2 since 61 and 67 are prime.
a(3) = 1 since 661 is the only prime.
MATHEMATICA
d = 6; Array[Length@ Select[d (10^# - 1)/9 + (Range[0, 9] - d), PrimeQ] &, 100]
Join[{4}, Table[Count[Table[10FromDigits[PadRight[{}, k, 6]]+n, {n, {1, 3, 7, 9}}], _?PrimeQ], {k, 110}]] (* Harvey P. Dale, Dec 23 2017 *)
PROG
(Python)
from __future__ import division
from sympy import isprime
def A266145(n):
return 4 if n==1 else sum(1 for d in [-5, -3, 1, 3] if isprime(2*(10**n-1)//3+d)) # Chai Wah Wu, Dec 27 2015
KEYWORD
base,nonn
AUTHOR
STATUS
approved