A120906 Triangle read by rows: T(n,k) is the number of ternary words of length n on {0,1,2} having k drops (n>=0, k>=0). The drops of a ternary word on {0,1,2} are the subwords 10,20 and 21.
1, 3, 6, 3, 10, 16, 1, 15, 51, 15, 21, 126, 90, 6, 28, 266, 357, 77, 1, 36, 504, 1107, 504, 36, 45, 882, 2907, 2304, 414, 9, 55, 1452, 6765, 8350, 2850, 210, 1, 66, 2277, 14355, 25653, 14355, 2277, 66, 78, 3432, 28314, 69576, 58278, 16236, 1221, 12, 91, 5005
Offset: 0
Examples
T(5,3) = 6 because we have 1/02/1/0, 2/02/1/0, 2/1/01/0, 2/1/02/0, 2/12/1/0 and 2/1/02/1, the middle points of the drops being indicated by /. Triangle starts: 1; 3; 6, 3; 10, 16, 1; 15, 51, 15; 21, 126, 90, 6;
Links
- Alois P. Heinz, Rows n = 0..200, flattened
Programs
-
Maple
G:=1/((1-z)^3-3*t*z^2+2*t*z^3-t^2*z^3): Gser:=simplify(series(G,z=0,15)): P[0]:=1: for n from 1 to 12 do P[n]:=sort(coeff(Gser,z^n)) od: for n from 0 to 12 do seq(coeff(P[n],t,j),j=0..floor(2*n/3)) od; # yields sequence in triangular form # second Maple program: b:= proc(n, i) option remember; `if`(n=0, 1, expand( add(b(n-1, j)*`if`(j (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)): seq(T(n), n=0..15); # Alois P. Heinz, May 19 2014
-
Mathematica
sol=Solve[{a==v z^2,b==v z^2,c==v(z^2+a z)},{a,b,c}];f[z_,u_]:=1/(1-3z-a-b-c)/.sol/.v->u-1;nn=10;Map[Select[#,#>0&]&,Level[CoefficientList[Series[f[z,u],{z,0,nn}],{z,u}],{2}]]//Grid (* Geoffrey Critzer, May 19 2014 *)
Formula
G.f.: G(t,z) = 1/[(1-z)^3-3tz^2+2tz^3-t^2*z^3].
Comments