login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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.
LINKS
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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)