The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A334404 a(0)=0; for n>0, a(n) is an integer not previously seen such that the sum of all previous terms plus a(n) equals the smallest prime number not yet created by any previous sum. 0
 0, 2, 1, 4, -2, 6, 8, -6, 10, 14, -20, 12, 18, -16, 22, -12, 20, -18, 16, 24, -10, 28, -34, 30, -26, 32, -24, 34, -4, 40, -60, 38, 36, -56, 44, -14, 42, -48, 26, 54, -72, 52, 48, -66, 50, -42, 46, -30, 60, -90, 62, -36, 58, -52, 64, -22, -8, 74, -38, 68, -54, 66, -78, 76, -70, 82, -46 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,2 COMMENTS See A175499 for an equivalent sequence which sums to the smallest positive integer not yet created. LINKS EXAMPLE a(1) = 2 as the sum of all previous terms plus a(1) = 0 + 2 = 2, where 2 has not previously occurred in the sequence and the prime 2 has not been previously created. a(2) = 1 as the sum of all previous terms plus a(2) = 0 + 2 + 1 = 3, where 1 has not previously occurred in the sequence and the prime 3 has not been previously created. a(3) = 4 as the sum of all previous terms plus a(3) = 0 + 2 + 1 + 4 = 7, where 4 has not previously occurred in the sequence and the prime 7 has not been previously created. Note that the next smallest uncreated prime after a(2) is 5 but that would require a(3) = 2 which is not allowed as a(1) = 2. a(4) = -2 as the sum of all previous terms plus a(4) = 0 + 2 + 1 + 4 - 2 = 5, where -2 has not previously occurred in the sequence and the prime 5 has not been previously created. MATHEMATICA Nest[Block[{k = 1, s = Total[#[[All, 1]] ], i = 1, p}, While[Nand[FreeQ[#[[All, -1]], Set[p, Prime@ i]], FreeQ[#[[All, 1]], p - s] ], i++]; While[Nand[FreeQ[#[[All, 1]], k], k + s == p], If[k < 0, Set[k, -k + 1], k *= -1]]; Append[#, {k, p}]] &, {{0, 0}}, 66][[All, 1]] (* Michael De Vlieger, Sep 11 2020 *) CROSSREFS Cf. A175499, A000040, A000217. Sequence in context: A330001 A292402 A205685 * A143375 A339418 A074364 Adjacent sequences:  A334401 A334402 A334403 * A334405 A334406 A334407 KEYWORD sign AUTHOR Scott R. Shannon, Sep 08 2020 STATUS approved

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

Last modified December 3 15:34 EST 2021. Contains 349463 sequences. (Running on oeis4.)