OFFSET
1,1
COMMENTS
The bracketing digit d must be 1, 3, 7, or 9.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
263 is included because 263 is a prime and 32633 (and also 92639) is a prime.
MAPLE
q:= p-> ormap(isprime, map(d-> parse(cat(d, p, d)), [1, 3, 7, 9])):
select(q, [ithprime(i)$i=1..67])[]; # Alois P. Heinz, Feb 22 2023
MATHEMATICA
brkQ[p_]:=AnyTrue[Table[FromDigits[Join[{d}, IntegerDigits[p], {d}]], {d, {1, 3, 7, 9}}], PrimeQ]; Select[Prime[Range[100]], brkQ]
PROG
(Python)
from sympy import isprime, nextprime
from itertools import islice
def agen(): # generator of terms
p = 2
while True:
sp = str(p)
if any(isprime(int(d+sp+d)) for d in "1379"):
yield p
p = nextprime(p)
print(list(islice(agen(), 57))) # Michael S. Branicky, Feb 20 2023
(PARI) is(p) = my(d=digits(p)); forstep(k=1, 9, 2, if (isprime(fromdigits(concat(k, concat(d, k)))), return(1)));
isok(p) = if (isprime(p), is(p)); \\ Michel Marcus, Feb 20 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Harvey P. Dale, Feb 20 2023
STATUS
approved