login
Triangle read by rows: T(n,k) is the number of weighted lattice paths B(n) having k (1,0)-steps. B(n) is the set of lattice paths of weight n that start in (0,0), end on the horizontal axis and never go below this axis, whose steps are of the following four kinds: a (1,0)-step with weight 1; a (1,0)-step with weight 2; a (1,1)-step with weight 2; a (1,-1)-step with weight 1. The weight of a path is the sum of the weights of its steps.
1

%I #16 Jun 29 2015 06:50:47

%S 1,0,1,0,1,1,1,0,2,1,0,3,1,3,1,0,3,6,3,4,1,2,0,12,11,6,5,1,0,10,6,30,

%T 19,10,6,1,0,10,30,30,61,31,15,7,1,5,0,60,80,90,110,48,21,8,1,0,35,30,

%U 210,200,211,183,71,28,9,1,0,35,140,210,575,462,426,287,101,36,10,1

%N Triangle read by rows: T(n,k) is the number of weighted lattice paths B(n) having k (1,0)-steps. B(n) is the set of lattice paths of weight n that start in (0,0), end on the horizontal axis and never go below this axis, whose steps are of the following four kinds: a (1,0)-step with weight 1; a (1,0)-step with weight 2; a (1,1)-step with weight 2; a (1,-1)-step with weight 1. The weight of a path is the sum of the weights of its steps.

%C Number of entries in row n is n+1.

%C Sum of entries in row n is A004148(n+1) (the 2ndary structure numbers).

%C T(3n,0)= A000108(n) (the Catalan numbers); T(n,0)=0 if n is not a multiple of 3.

%H Alois P. Heinz, <a href="/A246180/b246180.txt">Rows n = 0..140, flattened</a>

%H M. Bona and A. Knopfmacher, <a href="http://dx.doi.org/10.1007/s00026-010-0060-7">On the probability that certain compositions have the same number of parts</a>, Ann. Comb., 14 (2010), 291-306.

%F G.f. G=G(t,z) satisfies G = 1 + t*z*G + t*z^2*G + z^3*G^2.

%e Row 3 is 1,0,2,1. Indeed, denoting by h (H) the (1,0)-step of weight 1 (2), and u=(1,1), d=(1,-1), the four paths of weight 3 are: ud, hH, Hh, and hhh, having 0, 2, 2, and 3 (1,0)-steps, respectively.

%e Triangle starts:

%e 1;

%e 0,1;

%e 0,1,1;

%e 1,0,2,1;

%e 0,3,1,3,1;

%e 0,3,6,3,4,1;

%p eq := G = 1+t*z*G+t*z^2*G+z^3*G^2: G := RootOf(eq, G): Gser := simplify(series(G, z = 0, 17)): for n from 0 to 12 do P[n] := sort(coeff(Gser, z, n)) end do; for n from 0 to 12 do seq(coeff(P[n], t, k), k = 0 .. n) end do; # yields sequence in triangular form

%p # second Maple program:

%p b:= proc(n, y) option remember; `if`(y<0 or y>n, 0, `if`(n=0, 1,

%p expand(b(n-1, y)*x+ `if`(n>1, b(n-2, y)*x+

%p b(n-2, y+1), 0) +b(n-1, y-1))))

%p end:

%p T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):

%p seq(T(n), n=0..14); # _Alois P. Heinz_, Aug 26 2014

%t b[n_, y_] := b[n, y] = If[y<0 || y>n, 0, If[n==0, 1, Expand[b[n-1, y]*x + If[n>1, b[n-2, y]*x + b[n-2, y+1], 0] + b[n-1, y-1]]]]; T[n_] := Function[{p}, Table[ Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0]]; Table[T[n], {n, 0, 14}] // Flatten (* _Jean-François Alcover_, Jun 29 2015, after _Alois P. Heinz_ *)

%Y Cf. A004148, A000108.

%K nonn,tabl

%O 0,9

%A _Emeric Deutsch_, Aug 23 2014