OFFSET
0,8
COMMENTS
LINKS
Alois P. Heinz, Rows n = 0..140, flattened
M. Bona and A. Knopfmacher, On the probability that certain compositions have the same number of parts, Ann. Comb., 14 (2010), 291-306.
FORMULA
G.f. G=G(t,z) satisfies G = 1 + t*z*G + z^2*G + z^3*G^2.
EXAMPLE
Row 3 is 1,2,0,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, 1, 1, and 3 (1,0)-steps of weight 1, respectively.
Triangle starts:
1;
0,1;
1,0,1;
1,2,0,1;
1,3,3,0,1;
3,3,6,4,0,1;
MAPLE
eq := G = 1+t*z*G+z^2*G+z^3*G^2: G := RootOf(eq, G): Gser := simplify(series(G, z = 0, 22)): for n from 0 to 17 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 0 to 15 do seq(coeff(P[n], t, k), k = 0 .. n) end do; # yields sequence in triangular form
# second Maple program:
b:= proc(n, y) option remember; `if`(y<0 or y>n, 0,
`if`(n=0, 1, expand(b(n-1, y)*x+ `if`(n>1,
b(n-2, y)+b(n-2, y+1), 0) +b(n-1, y-1))))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
seq(T(n), n=0..12); # Alois P. Heinz, Aug 24 2014
MATHEMATICA
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] + 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, 12}] // Flatten (* Jean-François Alcover, Jun 29 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Emeric Deutsch, Aug 23 2014
STATUS
approved