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

A049976
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) = 1, a(2) = 3, and a(3) = 4.
0
1, 3, 4, 9, 21, 39, 81, 179, 418, 756, 1515, 3047, 6154, 12645, 26387, 57413, 135059, 243732, 487467, 974951, 1949962, 3900261, 7801619, 15607877, 31235987, 62580646, 125513700, 252489895, 510831447, 1045097262, 2184472237
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 < 4, [1, 3, 4][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: A092763 A232955 A116868 * A032789 A299123 A245455
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Nov 15 2019
STATUS
approved