OFFSET
1,4
FORMULA
a(n) = -a(A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 3 with a(1) = a(2) = 1. - Petros Hadjicostas, Sep 24 2019
EXAMPLE
From Petros Hadjicostas, Sep 24 2019:
a(3) = -a(A006257(3-2)) + a(1) + a(2) = -1 + 1 + 1 = 1.
a(4) = -a(A006257(4-2)) + a(1) + a(2) + a(3) = -1 + 1 + 1 + 1 = 2.
a(5) = -a(A006257(5-2)) + a(1) + a(2) + a(3) + a(4) = -1 + 1 + 1 + 1 + 2 = 4.
a(6) = -a(A006257(6-2)) + a(1) + a(2) + a(3) + a(4) + a(5) = 8.
(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(2*n - 4 - Bits:-Iff(n - 2, n - 2)); end proc;
seq(a(n), n = 1 .. 37); # Petros Hadjicostas, Sep 24 2019, courtesy of Peter Luschny
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name edited by Petros Hadjicostas, Sep 24 2019
STATUS
approved