login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A049892
a(n) = a(1) + a(2) + ... + a(n-1) - a(m) for n >= 4, 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) = a(2) = 1 and a(3) = 3.
0
1, 1, 3, 4, 6, 14, 26, 49, 78, 181, 360, 717, 1414, 2776, 5270, 9486, 15116, 35501, 71000, 141997, 283974, 567896, 1135510, 2269966, 4536076, 9062306, 18068728, 35924482, 70997428, 138594290, 263655928, 474383156, 756107812
OFFSET
1,3
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, 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: A180859 A271618 A137820 * A346504 A063477 A168219
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Nov 15 2019
STATUS
approved