login
A049975
a(n) = a(1) + a(2) + ... + a(n-1) + a(m) for n >= 4, where m = 2*n - 2 - 2^(p+1) and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1 and a(2) = a(3) = 3.
0
1, 3, 3, 10, 27, 47, 101, 239, 670, 1104, 2215, 4467, 9126, 19117, 41597, 97844, 274415, 450989, 901985, 1804007, 3608206, 7217277, 14437917, 28890484, 57859695, 116072535, 233498088, 472409446, 966492099, 2020166249
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, 3][n], s(n - 1) + a(-2^ceil(log[2](n - 1)) + 2*n - 2)):
end proc:
seq(a(n), n = 1..40); # Petros Hadjicostas, Apr 25 2020
CROSSREFS
Sequence in context: A229912 A321354 A019153 * A019168 A107299 A298899
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Apr 25 2020
STATUS
approved