OFFSET
1,4
FORMULA
From Petros Hadjicostas, Nov 06 2019: (Start)
a(n) = a(2^ceiling(log_2(n-1)) + 2 - n) + Sum_{i = 1..n-1} a(i) for n >= 4.
a(n) = a(n - 1 - 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(2^ceiling(log_2(4-1)) + 2 - 4) + a(1) + a(2) + a(3) = a(2) + a(1) + a(2) + a(3) = 4.
a(5) = a(2^ceiling(log_2(5-1)) + 2 - 5) + a(1) + a(2) + a(3) + a(4) = a(1) + a(1) + a(2) + a(3) + a(4) = 8.
a(6) = a(2^ceiling(log_2(6-1)) + 2 - 6) + a(1) + a(2) + a(3) + a(4) + a(5) = a(4) + a(1) + a(2) + a(3) + a(4) + a(5) = 19.
a(7) = a(7 - 1 - A006257(7-2)) + Sum_{i = 1..6} a(i) = a(3) + Sum_{i = 1..6} a(i) = 35.
a(8) = a(8 - 1 - A006257(8-2)) + Sum_{i = 1..7} a(i) = a(2) + Sum_{i = 1..7} a(i) = 70. (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 < 4, 1, s(n - 1) + a(Bits:-Iff(n - 2, n - 2) + 3 - n));
end proc;
seq(a(n), n = 1 .. 30);
MATHEMATICA
b[n_] := Module[{p}, For[p = 0, True, p++, If[2^p < n - 1 <= 2^(p + 1), Return[p]]]];
a[n_] := a[n] = If[n < 4, 1, With[{m = 2^(b[n] + 1) + 2 - n}, Total[ Array[a, n - 1]] + a[m]]];
Array[a, 35] (* Jean-François Alcover, Apr 24 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name edited by and more terms from Petros Hadjicostas, Nov 06 2019
STATUS
approved