login
A341696
The cumulative sum (1st digit + 2nd digit + 3rd digit + ... + n-th digit of the sequence) is prime.
0
2, 1, 4, 6, 40, 20, 46, 8, 42, 400, 60, 62, 64, 26, 406, 80, 48, 4000
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
Cf. A001223 (prime gaps).
Sequence in context: A145858 A328491 A328357 * A052566 A234946 A223092
KEYWORD
base,nonn,fini,full
AUTHOR
Eric Angelini, Feb 17 2021
STATUS
approved