|
|
A049913
|
|
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) = 4.
|
|
2
|
|
|
1, 2, 4, 5, 11, 18, 37, 76, 153, 231, 501, 1021, 2049, 4104, 8209, 16420, 32841, 49263, 106737, 217579, 437213, 875454, 1751428, 3503126, 7006330, 14012737, 28025513, 56051045, 112102097, 224204200, 448408401, 896816804, 1793633609
(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 < 4, [1, 2, 4][n], s(n - 1) - a(2^ceil(log[2](n - 1)) + 2 - n)):
end proc:
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|