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 A049922 #18 May 06 2022 13:12:15 %S A049922 1,3,2,5,8,18,34,69,135,274,546,1093,2183,4363,8716,17416,34797,69662, %T A049922 139322,278645,557287,1114571,2229132,4458248,8916461,17832856, %U A049922 35665573,71330874,142661201,285321312,570640444,1141276535,2282544370 %N A049922 a(n) = a(1) + a(2) + ... + a(n-1) - a(m) for n >= 4, where m = n - 1 - 2^p and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1, a(2) = 3 and a(3) = 2. %o A049922 (PARI) lista(nn) = { my(va = vector(nn)); va[1] = 1; va[2] = 3; va[3] = 2; my(sa = vecsum(va)); for (n=4, nn, va[n] = sa - va[n - 1 - 2^ceil(-1 + log(n-1)/log(2))]; sa += va[n]; ); va; } \\ _Petros Hadjicostas_, Apr 26 2020 (with nn > 2) %Y A049922 Cf. A049923 (similar, but with minus a(2*m)), A049970 (similar, but with plus a(m)), A049971 (similar, but with plus a(2*m)). %K A049922 nonn %O A049922 1,2 %A A049922 _Clark Kimberling_ %E A049922 Name edited by _Petros Hadjicostas_, Apr 26 2020