OFFSET
1,1
COMMENTS
This is the lexicographically earliest sequence of distinct terms > 0 with the property. The sequence stops after a(18) = 4000 as the cumulative sum is 113 at that point and the next prime (127) is impossible to reach with a single digit.
EXAMPLE
2 is prime, and so are the successive digit sums (2+1=3), (2+1+4=7), (2+1+4+6=13), (2+1+4+6+4=17), (2+1+4+6+4+0=17), (2+1+4+6+4+0+2=19), (2+1+4+6+4+0+2+0=19), etc.
MATHEMATICA
s = {}; sum = 0; Do[k = 1; While[MemberQ[s, k] || !AllTrue[(sumd = Accumulate @ IntegerDigits[k]), PrimeQ[sum + #] &], k++]; AppendTo[s, k]; sum += sumd[[-1]], {18}]; s (* Amiram Eldar, Feb 17 2021 *)
CROSSREFS
KEYWORD
base,nonn,fini,full
AUTHOR
Eric Angelini, Feb 17 2021
STATUS
approved