OFFSET
0,9
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 + t*z^2*G + z^3*G^2.
EXAMPLE
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.
Triangle starts:
1;
0,1;
0,1,1;
1,0,2,1;
0,3,1,3,1;
0,3,6,3,4,1;
MAPLE
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
# 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)*x+
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..14); # Alois P. Heinz, Aug 26 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]*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 *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Emeric Deutsch, Aug 23 2014
STATUS
approved