OFFSET
1,2
MATHEMATICA
a[n_] := (j = ToString[n]; l = {"1", "3", "7", "9", "01", "03", "07", "09"}; k = 1; While[p = ToExpression[ StringJoin[j, ToString[l[[k]] ]]]; k < 9 && ! PrimeQ[p], k++ ]; If[k < 9, Return[p]]; i = IntegerDigits[n]; k = 11; While[p = FromDigits[Join[i, IntegerDigits[k]]]; ! PrimeQ[p], k++ ]; Return[p]); b[n_] := (i = IntegerDigits[n]; k = 1; While[p = FromDigits[ Join[ IntegerDigits[k], i]]; !PrimeQ[p], k++ ]; Return[p]); f[1] = 1; f[n_] := If[ EvenQ[n], a[f[n - 1]], b[f[n - 1]]]; Table[ f[n], {n, 1, 18}]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amarnath Murthy, Mar 27 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Apr 03 2002
STATUS
approved