login
A049954
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 and a(2) = a(3) = 2.
3
1, 2, 2, 6, 13, 25, 51, 102, 208, 411, 823, 1646, 3296, 6599, 13210, 26446, 52943, 105785, 211571, 423142, 846288, 1692583, 3385178, 6770382, 13540815, 27081736, 54163675, 108327762, 216656347, 433314344, 866631991, 1733270593
OFFSET
1,2
MAPLE
s := proc(n) option remember; `if`(n < 1, 0, a(n) + s(n - 1)); end proc:
a := proc(n) option remember; `if`(n < 4, [1, 2, 2][n], s(n - 1) + a(-2^ceil(log[2](n - 1) - 1) + n - 1)); end proc:
seq(a(n), n = 1 .. 40); # Petros Hadjicostas, Apr 23 2020
CROSSREFS
Cf. A049906 (similar, but with minus a(m)), A049907 (similar, but with minus a(2*m)), A049955 (similar, but with plus a(2*m)).
Sequence in context: A159322 A049313 A062954 * A049952 A019100 A019101
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Apr 23 2020
STATUS
approved