%I #17 May 10 2020 22:57:22
%S 1,1,1,2,4,5,7,12,24,25,27,32,44,69,101,170,340,341,343,348,360,385,
%T 417,486,656,997,1345,1730,2216,3213,4943,8156,16312,16313,16315,
%U 16320,16332,16357,16389,16458,16628,16969,17317,17702
%N a(n) = a(n-1) + a(m) for n >= 4, where m = 2*n - 2 - 2^(p+1) and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = a(2) = a(3) = 1.
%H Ivan Neretin, <a href="/A050027/b050027.txt">Table of n, a(n) for n = 1..8193</a>
%p a := proc(n) option remember;
%p `if`(n < 4, [1,1,1][n], a(n - 1) + a(-2^ceil(log[2](n - 1)) + 2*n - 2)):
%p end proc:
%p seq(a(n), n = 1..40); # _Petros Hadjicostas_, Nov 18 2019
%t Fold[Append[#1, #1[[-1]] + #1[[#2]]] &, {1, 1, 1}, Flatten@Table[2 k, {n, 5}, {k, 2^n}]] (* _Ivan Neretin_, Sep 06 2015 *)
%o (PARI) lista(nn) = {nn = max(nn, 3); my(va = vector(nn)); va[1] = 1; va[2] = 1; va[3] = 1; for(n=4, nn, va[n] = va[n-1] + va[2*(n - 1 - 2^logint(n-2, 2))]); va; } \\ _Petros Hadjicostas_, May 10 2020
%K nonn
%O 1,4
%A _Clark Kimberling_
%E Name edited by _Petros Hadjicostas_, Nov 18 2019