OFFSET
1,1
MATHEMATICA
a[1] = 4; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, id = IntegerDigits[k]; If[id == Reverse[id], p = Product[a[j], {j, 1, n - 1}]*k + 1; If[PrimeQ[p] && PrimeQ[p-2], Return[k]]]]; Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 1, 28}] (* Jean-François Alcover, Jul 30 2017 *)
CROSSREFS
KEYWORD
nice,nonn,base
AUTHOR
Felice Russo, Dec 21 1999
EXTENSIONS
a(12)-a(28) from Donovan Johnson, Feb 17 2010
STATUS
approved