login
A049941
a(n) = a(1) + a(2) + ... + a(n-1) + a(m), where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n-1 <= 2^(p+1), starting with a(1) = a(2) = 1.
0
1, 1, 3, 6, 12, 29, 55, 108, 216, 539, 1025, 2024, 4031, 8056, 16109, 32216, 64432, 161079, 306051, 604049, 1204073, 2406139, 4811279, 9622072, 19243821, 38487534, 76975015, 153950004, 307899991, 615799976, 1231599949, 2463199896, 4926399792, 12315999479, 23400399011
OFFSET
1,3
FORMULA
From Petros Hadjicostas, Oct 06 2019: (Start)
a(n) = a(2 - n + 2^ceiling(log_2(n-1))) + Sum_{i = 1..n-1} a(i) for n >= 3.
a(n) = a(n - 1 - A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 3.
(End)
EXAMPLE
From Petros Hadjicostas, Oct 06 2019: (Start)
a(3) = a(2 - 3 + 2^ceiling(log_2(3-1))) + a(1) + a(2) = a(1) + a(1) + a(2) = 3.
a(4) = a(2 - 4 + 2^ceiling(log_2(4-1))) + a(1) + a(2) + a(3) = a(2) + a(1) + a(2) + a(3) = 6.
a(5) = a(5 - 1 - A006257(5-2)) + a(1) + a(2) + a(3) + a(4) = a(1) + a(1) + a(2) + a(3) + a(4) = 12.
(End)
MAPLE
a := proc(n) local i; option remember; if n < 3 then return [1, 1][n]; end if; add(a(i), i = 1 .. n - 1) + a(3 - n + Bits:-Iff(n - 2, n - 2)); end proc;
seq(a(n), n = 1 .. 35); # Petros Hadjicostas, Oct 06 2019
CROSSREFS
Cf. A006257.
Sequence in context: A025208 A245774 A369148 * A219634 A252696 A288147
KEYWORD
nonn
EXTENSIONS
More terms from Petros Hadjicostas, Oct 06 2019
STATUS
approved