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 A374966 #44 Apr 12 2025 12:03:03 %S A374966 0,1,3,0,4,9,15,22,30,0,10,21,33,46,60,0,16,33,51,70,90,0,0,23,47,72, %T A374966 98,125,153,182,0,31,63,0,34,69,105,142,180,219,259,300,342,385,429, %U A374966 474,0,0,48,97,147,0,52,105,159,214,270,327,385,444,0,61,123,0,64,129,195,262,330,0,0 %N A374966 a(n) = 0 if n has appeared in the sequence before, otherwise a(n) = a(n-1) + n. Start with a(0) = 0. %C A374966 The sequence seems to grow linearly. The average distance between zeros in the sequence appears to converge to about 7.42. %C A374966 The set of numbers appearing in this sequence is the union of {A375060(n)} and {A375060(n) + 1}. - _Yifan Xie_, Apr 09 2025 %H A374966 Michael De Vlieger, <a href="/A374966/b374966.txt">Table of n, a(n) for n = 0..16384</a> (terms 0..9999 from Bryle Morga). %H A374966 Michael De Vlieger, <a href="/A374966/a374966_1.png">Log log scatterplot of a(n)</a>, n = 0..2^20, showing zeros instead as 1/2 in red, otherwise blue. %H A374966 Bryle Morga, <a href="/A374966/a374966.png">Plot of the average distance between zeros for first 250000 terms.</a> %e A374966 a(1) = a(0) + 1 = 1. %e A374966 a(2) = a(1) + 2 = 3. %e A374966 a(3) = 0 because a(2) = 3. %t A374966 a={0}; For[n=1, n<=70, n++, If[MemberQ[a,n], AppendTo[a,0], AppendTo[a,Last[a]+n]]]; a (* _Stefano Spezia_, Jul 26 2024 *) %t A374966 Fold[If[MemberQ[#1, #2], Append[#1, 0], Append[#1, Last[#1] + #2]] &, {0}, Range @ 10^5] (* _Mikk Heidemaa_, Oct 05 2024 *) %o A374966 (Python) %o A374966 from itertools import count, islice %o A374966 def agen(): # generator of terms %o A374966 seen, an = {0}, 0 %o A374966 for n in count(1): %o A374966 yield an %o A374966 an = 0 if n in seen else an + n %o A374966 seen.add(an) %o A374966 print(list(islice(agen(), 71))) # _Michael S. Branicky_, Jul 25 2024 %Y A374966 Cf. A375060, A375065. %K A374966 nonn,easy,nice %O A374966 0,3 %A A374966 _Bryle Morga_, Jul 25 2024