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 A049902 #10 Nov 20 2019 01:41:36 %S A049902 1,2,1,3,5,11,21,43,84,170,339,679,1356,2710,5414,10818,21614,43270, %T A049902 86539,173079,346156,692310,1384614,2769218,5538414,11076787,22153488, %U A049902 44306807,88613274,177225871,354450388,708898072,1417790740 %N A049902 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) = 2, and a(3) = 1. %p A049902 s := proc(n) option remember; `if`(n < 1, 0, a(n) + s(n - 1)) end proc: %p A049902 a := proc(n) option remember; %p A049902 `if`(n < 4, [1, 2, 1][n], s(n - 1) - a(-2^ceil(-1 + log[2](n - 1)) + n - 1)): %p A049902 end proc: %p A049902 seq(a(n), n = 1..40); # _Petros Hadjicostas_, Nov 19 2019 %K A049902 nonn %O A049902 1,2 %A A049902 _Clark Kimberling_ %E A049902 Name edited by _Petros Hadjicostas_, Nov 19 2019