login
A049968
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) = 2.
0
1, 3, 2, 7, 15, 29, 59, 131, 306, 554, 1109, 2231, 4506, 9259, 19321, 42039, 98893, 178466, 356933, 713879, 1427802, 2855851, 5712505, 11428407, 22871629, 45822830, 91903700, 184878269, 374041241, 765241606, 1599515283
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, 2][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: A260141 A344494 A286940 * A363399 A049970 A344211
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Nov 15 2019
STATUS
approved