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”).

A049946
a(n) = a(1) + a(2) + ... + a(n-1) + a(m) for n >= 4, where m = n - 1 - 2^p 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) = 4.
1
1, 1, 4, 7, 14, 28, 56, 115, 233, 460, 920, 1843, 3689, 7385, 14784, 29596, 59251, 118388, 236776, 473555, 947113, 1894233, 3788480, 7576988, 15154035, 30308188, 60616603, 121233666, 242468255, 484938356, 969880408, 1939768215
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, 4][n], s(n - 1) + a(-2^ceil(-1 + log[2](n - 1)) + n - 1)):
end proc:
seq(a(n), n = 1..40); # Petros Hadjicostas, Apr 25 2020
CROSSREFS
Sequence in context: A128610 A305124 A094968 * A076975 A050343 A245002
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Apr 25 2020
STATUS
approved