login
A049949
a(n) = a(1) + a(2) + ... + a(n-1) + a(m) for n >= 4, where m = 2^(p+1) + 2 - n 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.
0
1, 2, 1, 6, 11, 27, 49, 99, 197, 492, 934, 1846, 3676, 7347, 14689, 29379, 58757, 146892, 279094, 550846, 1098021, 2194212, 4387512, 8774582, 17548869, 35097640, 70195230, 140390438, 280780860, 561561715, 1123123425, 2246246851
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, 1][n], s(n - 1) + a(2^ceil(log[2](n - 1)) + 2 - n)):
end proc:
seq(a(n), n = 1..34); # Petros Hadjicostas, Nov 12 2019
CROSSREFS
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Nov 12 2019
STATUS
approved