OFFSET
0,3
COMMENTS
LINKS
Alois P. Heinz, Rows n = 0..250, 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
The g.f. g = g(t,z) satisfies g = 1 + z*g + z^2*g + t*z^3*g*A, where A = 1 + z*g + z^2*g + z^3*g*A.
The above two equations follow from G(t,x,z) = 1 + z*G(t,1,z) + z^2*G(t,1,z) + t*x*z^3*G(t,1/t,z)*G(t,1,z); here G(t,x,z) is the trivariate g.f. of the paths B(n), where t marks ascents, x marks the fact that the path starts with an (1,1)-step, and z marks weight.
EXAMPLE
Row 3 is 3,1. Indeed, denoting by h (H) the (1,0)-step of weight 1 (2), and U=(1,1), D=(1,-1), the paths in B(3) are hhh, hH, Hh, and UD, having ascents 0, 0, 0, and 1, respectively.
Triangle starts:
1;
1;
2;
3,1;
5,3;
8,9;
13,23,1;
21,55,6;
MAPLE
eq := z^3*(-z^2+z^2*t-z+z*t+1)*g^2+(t*z^3-1-z^3+z^2+z)*g+1: g := RootOf(eq, g): gser := simplify(series(g, z = 0, 25)): for n from 0 to 20 do P[n] := sort(coeff(gser, z, n)) end do: for n from 0 to 20 do seq(coeff(P[n], t, k), k = 0 .. floor((1/3)*n)) end do; # yields sequence in triangular form
# second Maple program:
b:= proc(n, y, t) option remember; `if`(y<0 or y>n, 0,
`if`(n=0, 1, expand(b(n-1, y, 0)+`if`(n>1, b(n-2, y, 0)+
b(n-2, y+1, 1)*`if`(t=0, x, 1), 0) +b(n-1, y-1, 0))))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$2)):
seq(T(n), n=0..20); # Alois P. Heinz, Aug 30 2014
MATHEMATICA
b[n_, y_, t_] := b[n, y, t] = If[y<0 || y>n, 0, If[n==0, 1, Expand[b[n-1, y, 0] + If[n>1, b[n-2, y, 0] + b[n-2, y+1, 1]*If[t==0, x, 1], 0] + b[n-1, y-1, 0]]]]; T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0, 0]]; Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, Feb 19 2016, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Emeric Deutsch, Aug 30 2014
STATUS
approved