%I #10 Feb 19 2015 05:45:33
%S 2,3,1,4,2,1,6,3,2,1,9,6,3,2,1,13,11,7,3,2,1,19,18,14,8,3,2,1,28,30,
%T 24,17,9,3,2,1,41,50,43,30,20,10,3,2,1,60,81,77,57,36,23,11,3,2,1,88,
%U 130,132,108,72,42,26,12,3,2,1,129,208,224,193,143,88,48,29,13,3,2,1
%N Triangle read by rows: T(n,k) is the number of 010-avoiding binary words of length n containing k 00 subwords (0<=k<=n-1).
%C Sum of entries in row n = A005251(n+3).
%C T(n,0) = A000930(n+2).
%C Sum(k*T(n,k), k=0..n-1) = A118430(n+1).
%H Alois P. Heinz, <a href="/A143361/b143361.txt">Rows n = 1..150, flattened</a>
%F G.f.: G(t,z) = (1+z-tz+z^2)/(1-z-tz+tz^2-z^3)-1.
%e T(5,2)=3 because we have 00011, 10001 and 11000.
%e Triangle starts:
%e 2;
%e 3, 1;
%e 4, 2, 1;
%e 6, 3, 2, 1;
%e 9, 6, 3, 2, 1;
%e 13, 11, 7, 3, 2, 1;
%p G:=(1+z-t*z+z^2)/(1-z-t*z+t*z^2-z^3)-1: Gser:=simplify(series(G,z=0,14)): for n to 12 do P[n]:=sort(coeff(Gser,z,n)) end do: for n to 12 do seq(coeff(P[n], t,j),j=0..n-1) end do; # yields sequence in triangular form
%p # second Maple program:
%p b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<3,
%p expand(b(n-1, i+1) +b(n-1, i)*`if`(i=2, x, 1)), b(n-1, 1)))
%p end:
%p T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 1)):
%p seq(T(n), n=0..15); # _Alois P. Heinz_, Dec 18 2013
%t b[n_, i_] := b[n, i] = If[n == 0, 1, If[i<3, Expand[b[n-1, i+1] + b[n-1, i]*If[i == 2, x, 1]], b[n-1, 1]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 1]]; Table[T[n], {n, 1, 15}] // Flatten (* _Jean-François Alcover_, Feb 19 2015, after _Alois P. Heinz_ *)
%Y Cf. A005251, A000930, A118430.
%K nonn,tabl
%O 1,1
%A _Emeric Deutsch_, Aug 15 2008