OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..275 (1..80 from Harvey P. Dale, 81..178 from David A. Corneth, all terms with <= 1000 digits)
MATHEMATICA
Join[Prime[Range[25]], Select[Prime[Range[26, 4500]], Union[Most[ Rest[ IntegerDigits[ #]]]] =={2}&]] (* Harvey P. Dale, Aug 12 2021 *)
PROG
(PARI) uptoqdigits(n) = { my(ld = [1, 3, 7, 9]); n = max(n, 2); res = List(primes(primepi(97))); for(i = 1, n-2, twos = 20*(10^i\9); for(j = 1, 9, for(k = 1, #ld, c = j*10^(i+1) + twos + ld[k]; if(isprime(c), listput(res, c) ) ) ) ); Set(res) } \\ David A. Corneth, Aug 12 2021
(Python)
from sympy import isprime
def agen(maxdigits):
yield from [2, 3, 5, 7]
for d in range(2, maxdigits+1):
pow10, mid = 10**(d-1), 0 if d < 3 else 10*int('2'*(d-2))
cands = (a*pow10+mid+b for a in range(1, 10) for b in [1, 3, 7, 9])
yield from filter(isprime, cands)
print([an for an in agen(100)]) # Michael S. Branicky, Aug 12 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amarnath Murthy, Apr 06 2002
EXTENSIONS
Corrected by Ray Chandler, Nov 24 2003
Offset corrected and name changed by Arkadiusz Wesolowski, Sep 07 2011
STATUS
approved