This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A334404 #22 Sep 14 2020 05:45:36 %S A334404 0,2,1,4,-2,6,8,-6,10,14,-20,12,18,-16,22,-12,20,-18,16,24,-10,28,-34, %T A334404 30,-26,32,-24,34,-4,40,-60,38,36,-56,44,-14,42,-48,26,54,-72,52,48, %U A334404 -66,50,-42,46,-30,60,-90,62,-36,58,-52,64,-22,-8,74,-38,68,-54,66,-78,76,-70,82,-46 %N 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. %C A334404 See A175499 for an equivalent sequence which sums to the smallest positive integer not yet created. %e A334404 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. %e A334404 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. %e A334404 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. %e A334404 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. %t A334404 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 *) %Y A334404 Cf. A175499, A000040, A000217. %K A334404 sign %O A334404 0,2 %A A334404 _Scott R. Shannon_, Sep 08 2020