|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
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:
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|