login
A049944
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), with a(1) = a(2) = 1 and a(3) = 4.
0
1, 1, 4, 7, 17, 31, 65, 143, 334, 604, 1211, 2435, 4918, 10105, 21087, 45881, 107931, 194776, 389555, 779123, 1558294, 3116857, 6234591, 12472889, 24961947, 50010738, 100303100, 201774939, 408226175, 835179706, 1745700565, 3799324205, 8936122800, 16126545036, 32253090075
OFFSET
1,3
FORMULA
From Petros Hadjicostas, Nov 06 2019: (Start)
a(n) = a(2*n - 3 - 2^ceiling(log_2(n-1))) + Sum_{i = 1..n-1} a(i) for n >= 4.
a(n) = a(A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 4. (End)
EXAMPLE
From Petros Hadjicostas, Nov 06 2019: (Start)
a(4) = a(A006257(4-2)) + a(1) + a(2) + a(3) = a(1) + a(1) + a(2) + a(3) = 7.
a(5) = a(A006257(5-2)) + a(1) + a(2) + a(3) + a(4) = a(3) + a(1) + a(2) + a(3) + a(4) = 17.
a(6) = a(2*6 - 3 - 2^ceiling(log_2(6-1))) + a(1) + a(2) + a(3) + a(4) + a(5) = a(1) + a(1) + a(2) + a(3) + a(4) + a(5) = 31. (End)
MAPLE
s := proc(n) option remember; `if`(n < 1, 0, a(n) + s(n - 1)); end proc;
a := proc(n) option remember;
`if`(n < 3, 1, `if`(n < 4, 4, s(n - 1) + a(2*n - 4 - Bits:-Iff(n - 2, n - 2))));
end proc;
seq(a(n), n = 1..40); # Petros Hadjicostas, Nov 06 2019
CROSSREFS
Cf. A006257.
Sequence in context: A302549 A023860 A009881 * A098091 A319782 A374563
KEYWORD
nonn
EXTENSIONS
Name edited by and more terms from Petros Hadjicostas, Nov 06 2019
STATUS
approved