OFFSET
0,1
COMMENTS
No such prime exists if n is even or divisible by 5. It is not until n = 69 that it necessary to insert more than one digit. The next few examples are 99, 101, 103, 123, 157, 181 & 199.
Insignificant leading 0's in the inserted value are not permitted, otherwise we would have a(34) = 690269. - Sean A. Irvine, Jun 06 2024
MATHEMATICA
f[n_] := Block[{a = IntegerDigits[n]}, If[ Mod[n, 5] == 0, Return[0], If[ p = FromDigits[ Join[a, a]]; PrimeQ[p], Return[p], k = 0; While[p = FromDigits[ Join[a, IntegerDigits[k], a]]; !PrimeQ[p], k++ ]]; p]]; Table[ f[n], {n, 1, 89, 2}]
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, May 07 2002
EXTENSIONS
STATUS
approved