OFFSET
1,2
FORMULA
a(n) = a(2*n - 3 - 2^ceiling(log_2(n-1))) + Sum_{i = 1..n-1} a(i) = a(A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 4 with a(1) = 1, a(2) = 3, and a(3) = 1. - Petros Hadjicostas, Sep 24 2019
EXAMPLE
From Petros Hadjicostas, Sep 24 2019: (Start)
a(4) = a(1) + a(2) + a(3) + a(m=1) = 1 + 3 + 1 + 1 = 6 because m = A006257(4-2) = 2*4 - 3 - 2^ceiling(log_2(4-1)) = 1.
a(5) = a(1) + a(2) + a(3) + a(4) + a(m=3) = 1 + 3 + 1 + 6 + 1 = 12 because m = A006257(5-2) = 2*5 - 3 - 2^ceiling(log_2(5-1)) = 3.
a(6) = a(1) + a(2) + a(3) + a(4) + a(5) + a(m=1) = 1 + 3 + 1 + 6 + 12 + 1 = 24 because m = A006257(6-2) = 2*6 - 3 - 2^ceiling(log_2(6-1)) = 1.
(End)
MAPLE
a := proc(n) option remember; if n<4 then return [1, 3, 1][n] fi; add(a(i), i=1..n-1) + a(2*(n-2) - Bits:-Iff(n-2, n-2)) end: seq(a(n), n=1..37); # Petros Hadjicostas, Sep 24 2019, courtesy of Peter Luschny
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name edited by and more terms from Petros Hadjicostas, Sep 23 2019
STATUS
approved