Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #24 May 06 2022 13:11:36
%S 1,1,1,4,8,19,35,70,140,349,663,1310,2609,5214,10425,20850,41700,
%T 104249,198073,390935,779265,1557231,3113815,6227316,12454423,
%U 24908776,49817517,99635018,199270025,398540046,797080089,1594160178,3188320356,7970800889,15144521689
%N a(n) = a(1) + a(2) + ... + a(n-1) + a(m) for n >= 4, 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) = a(3) = 1.
%F From _Petros Hadjicostas_, Nov 06 2019: (Start)
%F a(n) = a(2^ceiling(log_2(n-1)) + 2 - n) + Sum_{i = 1..n-1} a(i) for n >= 4.
%F a(n) = a(n - 1 - A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 4. (End)
%e From _Petros Hadjicostas_, Nov 06 2019: (Start)
%e 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.
%e 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.
%e 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.
%e a(7) = a(7 - 1 - A006257(7-2)) + Sum_{i = 1..6} a(i) = a(3) + Sum_{i = 1..6} a(i) = 35.
%e a(8) = a(8 - 1 - A006257(8-2)) + Sum_{i = 1..7} a(i) = a(2) + Sum_{i = 1..7} a(i) = 70. (End)
%p s := proc(n) option remember; `if`(n < 1, 0, a(n) + s(n - 1)); end proc;
%p a := proc(n) option remember;
%p `if`(n < 4, 1, s(n - 1) + a(Bits:-Iff(n - 2, n - 2) + 3 - n));
%p end proc;
%p seq(a(n), n = 1 .. 30);
%t b[n_] := Module[{p}, For[p = 0, True, p++, If[2^p < n - 1 <= 2^(p + 1), Return[p]]]];
%t a[n_] := a[n] = If[n < 4, 1, With[{m = 2^(b[n] + 1) + 2 - n}, Total[ Array[a, n - 1]] + a[m]]];
%t Array[a, 35] (* _Jean-François Alcover_, Apr 24 2020 *)
%Y Cf. A006257, A049885 (similar, but with minus a(m)), A049937, A049945.
%K nonn
%O 1,4
%A _Clark Kimberling_
%E Name edited by and more terms from _Petros Hadjicostas_, Nov 06 2019