OFFSET
0,2
COMMENTS
Row n has 1 + floor(n/2) terms.
Row sums yield A005773.
LINKS
Alois P. Heinz, Rows n = 0..200, flattened
Marilena Barnabei, Flavio Bonetti, and Niccolò Castronuovo, Motzkin and Catalan Tunnel Polynomials, J. Int. Seq., Vol. 21 (2018), Article 18.8.8.
FORMULA
EXAMPLE
T(3,1)=4 because we have HUD, UDH, UDU and UUD.
Triangle starts:
1;
2;
4, 1;
9, 4;
21, 13, 1;
50, 40, 6;
121, 118, 27, 1;
MAPLE
G:=((-1+3*z-z^2+t*z^2+sqrt((1+z+z^2-t*z^2)*(1-3*z+z^2-t*z^2)))*1/2)/(z*(1-3*z+z^2-t*z^2)): Gser:=simplify(series(G, z=0, 15)): 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, j), j=0..floor((1/2)*n)) end do; # yields sequence in triangular form
# second Maple program:
b:= proc(x, y, t) option remember; expand(`if`(y<0, 0,
`if`(x=0, 1, b(x-1, y, 1)+b(x-1, y-1, 1)*t+b(x-1, y+1, z))))
end:
T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(n, 0, 1)):
seq(T(n), n=0..15); # Alois P. Heinz, Feb 01 2019
MATHEMATICA
b[x_, y_, t_] := b[x, y, t] = Expand[If[y < 0, 0, If[x == 0, 1, b[x - 1, y, 1] + b[x - 1, y - 1, 1]*t + b[x - 1, y + 1, z]]]];
T[n_] := Function[p, Table[Coefficient[p, z, i], {i, 0, Exponent[p, z]}]] @ b[n, 0, 1];
T /@ Range[0, 15] // Flatten (* Jean-François Alcover, Oct 06 2019, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Emeric Deutsch, Oct 08 2007
STATUS
approved