A120924 Triangle read by rows: T(n,k) is the number of ternary words of length n on {0,1,2}, having k isolated 0's (n >= 0, k >= 0).
1, 2, 1, 5, 4, 13, 12, 2, 33, 36, 12, 83, 108, 48, 4, 209, 316, 172, 32, 527, 904, 588, 160, 8, 1329, 2548, 1932, 672, 80, 3351, 7104, 6140, 2592, 480, 16, 8449, 19628, 19020, 9440, 2320, 192, 21303, 53816, 57756, 32896, 10000, 1344, 32, 53713, 146596
Offset: 0
Examples
T(2,0)=5 because we have 00,11,12,21 and 22; T(2,1)=4 because we have 01,02,10 and 20; T(3,2)=2 because we have 010 and 020. Triangle starts: 1; 2, 1; 5, 4; 13, 12, 2; 33, 36, 12; 83, 108, 48, 4;
Programs
-
Maple
G:=(1-(1-t)*z*(1-z))/(1-3*z+2*(1-t)*z^2*(1-z)): Gser:=simplify(series(G,z=0,15)): P[0]:=1: for n from 1 to 13 do P[n]:=sort(coeff(Gser,z^n)) od: for n from 0 to 13 do seq(coeff(P[n],t,j),j=0..ceil(n/2)) od; # yields sequence in triangular form
Formula
G.f. = G(t,z) = (1-(1-t)z(1-z))/(1 - 3z + 2(1-t)z^2*(1-z)).
Comments