OFFSET
1,2
COMMENTS
See A219110 for the numbers which do not occur in this sequence. See A219250 for the analog when "sum" is replaced with "absolute difference", and A219248-A219251 for related sequences. - M. F. Hasler, Apr 11 2013
LINKS
Zak Seidov, Table of n, a(n) for n = 1..10000
EXAMPLE
20 follows 9 since 9+2 and 2+0 is prime, and no number less than 20 (not already in the sequence) satisfies the stated property.
MATHEMATICA
a[1] = 1; a[n_] := a[n] = For[id = IntegerDigits[a[n-1]]; k = 1, True, k++, If[FreeQ[Array[a, n-1], k], dd = Join[id, IntegerDigits[k]]; If[And @@ PrimeQ /@ Plus @@@ Transpose[{Most[dd], Rest[dd]}], Return[k]]]]; Array[a, 62] (* Jean-François Alcover, Apr 17 2013 *)
PROG
(PARI) A182178_vec={(n, a=[1], u=0)->while(#a<n, u+=1<<a[#a]; for(t=a[1]+1, 9e9, bittest(u, t)&next; my(d=concat(a[#a]%10, digits(t))); for(i=2, #d, isprime(d[i-1]+d[i])||next(2)); a=concat(a, t); break)); a} \\ M. F. Hasler, Apr 11 2013
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Jim Nastos and Eric Angelini, Apr 16 2012
STATUS
approved