OFFSET
1,1
LINKS
Michael De Vlieger and Robert G. Wilson v, Table of n, a(n) for n = 1..1215
EXAMPLE
a(2) = 8 from 17, 37, 47, 67, 71, 73, 79, 97. - N. J. A. Sloane, Dec 27 2015
a(3) = 10 since 277, 577, 677, 727, 757, 773, 787, 797, 877, and 977 are primes.
MATHEMATICA
f7[n_] := Block[{cnt = k = 0, r = 7 (10^n - 1)/9, s = Range[0, 9] - 7}, While[k < n, cnt += Length@ Select[r + 10^k*s, PrimeQ@ # && IntegerLength@ # > k &]; k++]; cnt]; Array[f7, 100]
PROG
(PARI) a(n)={sum(i=0, n-1, sum(d=i==n-1, 9, isprime((10^n-1)/9*7 + (d-7)*10^i)))} \\ Andrew Howroyd, Feb 28 2018
(Python)
from __future__ import division
from sympy import isprime
def A266146(n):
return 4*n if (n==1 or n==2) else sum(1 for d in range(-7, 3) for i in range(n) if isprime(7*(10**n-1)//9+d*10**i)) # Chai Wah Wu, Dec 27 2015
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Michael De Vlieger and Robert G. Wilson v, Dec 21 2015
EXTENSIONS
a(2) corrected by Chai Wah Wu, Dec 27 2015
a(2) corrected in b-file as above by Andrew Howroyd, Feb 28 2018
STATUS
approved