OFFSET
1,1
LINKS
Jason Bard, Table of n, a(n) for n = 1..10000
MAPLE
with(numtheory): for n from 2 to 10000 do: l:=evalf(floor(ilog10(n))+1): n0:=n:indic:=0:for m from 1 to l do:q:=n0:u:=irem(q, 10):v:=iquo(q, 10): n0:=v : if u=3 or u= 5 or u= 6 or u=7 or u=9 then indic :=1 :else fi :od :if indic = 0 and type(n, prime) = true then print(n):else fi:od:
MATHEMATICA
Join[{2}, Select[Map[FromDigits, Tuples[{0, 1, 2, 4, 8}, 3]]*10 + 1, PrimeQ]] (* Paolo Xausa, Jun 12 2025 *)
PROG
(Python)
from sympy import isprime
from itertools import count, islice, product
def agen(): # generator of terms
yield 2
yield from (t for digits in count(2) for f in "1248" for mid in product("01248", repeat=digits-2) if isprime(t:=int(f + "".join(mid) + "1")))
print(list(islice(agen(), 45))) # Michael S. Branicky, Jun 11 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Feb 22 2010
STATUS
approved
