OFFSET
1,1
EXAMPLE
2312 is a term because 123121, 323123, 723127 and 923129 are all primes.
MATHEMATICA
Select[ Range[ 30000 ], PrimeQ[ ToExpression[ StringInsert[ ToString[ # ], "1", {1, -1} ] ] ] && PrimeQ[ ToExpression[ StringInsert[ ToString[ # ], "3", {1, -1} ] ] ] && PrimeQ[ ToExpression[ StringInsert[ ToString[ # ], "7", {1, -1} ] ] ] && PrimeQ[ ToExpression[ StringInsert[ ToString[ # ], "9", {1, -1} ] ] ] & ]
enclose[n_]:=Table[FromDigits[Join[{i}, IntegerDigits[n], {i}]], {i, {1, 3, 7, 9}}]; Select[Range[30000], AllTrue[enclose[#], PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 21 2015 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Harvey P. Dale, Feb 05 2001
EXTENSIONS
More terms from Patrick De Geest, Feb 07 2001
STATUS
approved