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 A008345 #26 Jan 11 2020 07:46:47 %S A008345 0,1,4,10,0,15,36,8,44,89,34,100,22,113,8,128,264,111,282,92,302,71, %T A008345 324,48,348,23,374,752,346,781,316,812,284,845,250,880,214,917,176, %U A008345 956,136,997,94,1040,50,1085,4,1132,2308,1083,2358,1032,2410,979,2464,924 %N A008345 a(n+1) = a(n)-b(n+1) if a(n) >= b(n+1) else a(n)+b(n+1), where {b(n)} are the triangular numbers A000217. %C A008345 a(0) and a(4) are both zero. Are there any other zero values? - _N. J. A. Sloane_, Sep 12 2019 %H A008345 Rémy Sigrist, <a href="/A008345/b008345.txt">Table of n, a(n) for n = 0..25000</a> (first 1001 terms from Franklin T. Adams-Watters) %p A008345 A008345 := proc(n) option remember; if n = 1 then n-1 elif A008345(n-1) >= n*(n+1)/2 then A008345(n-1)-n*(n+1)/2 else A008345(n-1)+n*(n+1)/2; fi; end; %t A008345 nxt[{n_,a_}]:=Module[{tr=((n+1)(n+2))/2},{n+1,If[a>=tr,a-tr,a+tr]}]; Transpose[NestList[nxt,{0,0},50]][[2]] (* _Harvey P. Dale_, Jun 19 2013 *) %Y A008345 Cf. A000217, A008344, A076042. %K A008345 nonn,easy %O A008345 0,3 %A A008345 _N. J. A. Sloane_ and _J. H. Conway_