OFFSET
0,1
EXAMPLE
a(1) = 3 because 131 is prime.
a(2) = 11 since 1111 = 11*101.
a(3) = 13 because 1131 = 3*13*29.
a(4) = 157 since 11571 = 3*7*19*29.
a(5) = 8209 since 182091 = 3*7*13*23*29.
a(6) = 31231 since 1312311 = 3*7*11*13*19*23.
MATHEMATICA
pf[n_] := Flatten[ Table[ #[[1]], {#[[2]]}] & /@ FactorInteger[n]]; t = Table[0, {9}]; Do[ a = pf[ FromDigits[ Join[{1}, IntegerDigits[ Prime[n]], {1}]]]; If[a == Union[a], l = Length[a]; If[ t[[l]] == 0, t[[l]] = Prime[n]]], {n, 10^7}] (* also for n>2 I used *) (* Robert G. Wilson v, Apr 16 2005 *)
(* first do *) Needs["DiscreteMath`Combinatorica`"] (* then *) Table[ FromDigits[ Take[ IntegerDigits[ Select[ Sort[ Times @@@ KSubsets[ Drop[ Prime[ Range[25]], {1, 3, 2}], n]], Take[ RotateRight[ IntegerDigits[ # ]], 2] == {1, 1} && IntegerDigits[ # ][[2]] != 0 && PrimeQ[ FromDigits[ Drop[ RotateRight[ IntegerDigits[ # ]], 2]]] &][[1]]], {2, -2}]], {n, 3, 20}]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Lekraj Beedassy, Apr 14 2005
EXTENSIONS
Extended by Robert G. Wilson v, Apr 16 2005
STATUS
approved