OFFSET
1,3
EXAMPLE
The first few terms are 1,1,3,11,1,3,3,53,13,39,9,3. The next integer you can concatenate to the end of this to get a prime is 21 so the next term is 21. If you require terms to have all digits odd you would get 399 instead, giving A069604.
MATHEMATICA
nn[a_] := For[b = 1, ! PrimeQ[n], b = b + 1, n = a*10^Floor[Log[10, b] + 1]] (* o get the next number in the sequence if a is the concatenation of all previous. *) nnt[m_] := (t = 1; Table[c = nnn[t]; t = c[[2]]; c[[1]], {m}]) (* To get a table of the first n terms, ignoring a(1)=1*)
a[1] = 1; a[n_] := a[n] = Block[{k = 1, c = IntegerDigits @ Table[ a[i], {i, n - 1}]}, While[ !PrimeQ[ FromDigits @ Flatten @ Append[c, IntegerDigits[k]]], k += 2]; k]; Table[ a[n], {n, 63}] (* Robert G. Wilson v, Aug 05 2005 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Christer Mauritz Blomqvist (MauritzTortoise(AT)hotmail.com), Apr 08 2004
STATUS
approved