%I #13 Apr 25 2024 13:55:38
%S 0,0,0,1,0,0,1,2,0,0,1,1,0,1,3,3,0,0,1,1,0,1,3,2,0,1,2,1,1,4,6,4,0,0,
%T 1,1,0,1,3,2,0,1,2,1,1,4,6,3,0,1,2,1,1,4,5,2,1,3,3,2,5,10,10,5,0,0,1,
%U 1,0,1,3,2,0,1,2,1,1,4,6,3,0,1,2,1,1,4,5,2,1,3,3,2,5,10,10,4,0,1,2,1,1,4,5
%N a(0)=0; a(1)=0; a(2)=0; for n>=3 if n=2^i + j with 0<=j<2^i then a(n)=a(j) + a(j + 1) except we add 1 if j=2^i-1.
%H Alois P. Heinz, <a href="/A151843/b151843.txt">Table of n, a(n) for n = 0..10000</a>
%F I would very much like a g.f. for this sequence!
%e From _Omar E. Pol_, Jul 17 2009: (Start)
%e Triangle begins:
%e 0;
%e 0;
%e 0,1;
%e 0,0,1,2;
%e 0,0,1,1,0,1,3,3;
%e 0,0,1,1,0,1,3,2,0,1,2,1,1,4,6,4;
%e ... (End)
%p M:=520;
%p f:=proc(r,s,a,b) local s1,n,i,j; global M;
%p s1:=array(0..M+10);
%p s1[0]:=r; s1[1]:=s;
%p for n from 2 to M do i:=floor(log(n)/log(2));
%p j:=n-2^i;
%p if (j=2^i-1) then s1[n]:=a*s1[j]+b*s1[j+1]+1 else
%p s1[n]:=a*s1[j]+b*s1[j+1]; fi;
%p od:
%p [seq(s1[n],n=0..M)];
%p end;
%p f(0,0,1,1);
%t M = 520; f[r_, s_, a_, b_] := Module[{s1, n, i, j} , s1[0] = r; s1[1] = s; For[n = 2, n <= M, n++, i = Floor[Log[2, n]]; j = n - 2^i; If[j == 2^i - 1, s1[n] = a*s1[j]+b*s1[j+1]+1, s1[n] = a*s1[j]+b*s1[j+1]]]; Table[s1[n], {n, 0, M}]]; f[0, 0, 1, 1] (* _Jean-François Alcover_, Mar 03 2014, after Maple *)
%Y Cf. A151843-A151874.
%K nonn,look
%O 0,8
%A _N. J. A. Sloane_, Jul 17 2009, Jul 19 2009