login
A049959
a(n) = a(1) + a(2) + ... + a(n-1) + a(m) for n >= 4, where m = 2*n - 2 - 2^(p+1) 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) = 3.
4
1, 2, 3, 8, 22, 38, 82, 194, 544, 896, 1798, 3626, 7408, 15518, 33766, 79424, 222754, 366086, 732178, 1464386, 2928928, 5858558, 11719846, 23451584, 46967074, 94220810, 189539920, 383474012, 784541050, 1639851326, 3568955854
OFFSET
1,2
FORMULA
a(n) = 2*A049935(n) for n > 3. - Petros Hadjicostas, Apr 27 2020
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, 3][n], s(n - 1) + a(-2^ceil(log[2](n - 1)) + 2*n - 2)):
end proc:
seq(a(n), n = 1..40); # Petros Hadjicostas, Apr 25 2020
CROSSREFS
Cf. A049910 (similar, but with minus a(m/2)), A049911 (similar, but with minus a(m)), A049935, A049958 (similar, but with plus a(m/2)).
Sequence in context: A098119 A376521 A376520 * A006545 A089402 A127940
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Apr 25 2020
STATUS
approved