login
A049924
a(n) = a(1) + a(2) + ... + a(n-1) - a(m) for n >= 3, where m = 2*n - 3 - 2^(p+1) and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1 and a(2) = 3.
0
1, 3, 3, 6, 10, 22, 42, 77, 122, 285, 568, 1129, 2226, 4372, 8298, 14938, 23804, 55905, 111808, 223609, 447186, 894292, 1788138, 3574618, 7143164, 14270822, 28453640, 56571902, 111802852, 218250678, 415190880, 747032548, 1190677068
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 < 3, [1, 3][n], s(n - 1) - a(-2^ceil(log[2](n - 1)) + 2*n - 3)):
end proc:
seq(a(n), n = 1..40); # Petros Hadjicostas, Nov 15 2019
CROSSREFS
Sequence in context: A298164 A304265 A049871 * A049926 A298954 A169944
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Nov 15 2019
STATUS
approved