OFFSET
0,3
COMMENTS
LINKS
Alois P. Heinz, Rows n = 0..220, flattened
FORMULA
G.f.: G=G(t,z) satisfies aG^2 + bG -1 = 0, where a=z(1-z-z^2-z^3-tz+tz^2+tz^3), and b=1-2z-z^2+tz^2.
EXAMPLE
T(7,1) = 2 because we have UUUDDDH and HUUUDDD, where U=(1,1), H=(1,0), and D=(1,-1).
Triangle starts:
1;
1;
2;
3;
6;
10;
19, 1;
33, 2;
62, 7, 1;
MAPLE
a := z*(1-z-z^2-z^3-t*z+t*z^2+t*z^3): b := 1-2*z-z^2+t*z^2: G := RootOf(a*g^2+b*g-1 = 0, g): Gser := simplify(series(G, z = 0, 21)): for n from 0 to 18 do P[n] := sort(coeff(Gser, z, n)) end do: 1; 1; 2; 3; for n from 4 to 18 do seq(coeff(P[n], t, k), k = 0 .. floor((1/2)*n)-2) end do; # yields sequence in triangular form
# second Maple program:
b:= proc(x, y, t) option remember; `if`(y<0 or y>x, 0,
`if`(x=0, 1, expand(b(x-1, y+1, min(t+1, 3))*
`if`(t=3, z, 1) +b(x-1, y-1, 1)+ `if`(y=0, b(x-1, 0, 1), 0))))
end:
T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(n, 0, 1)):
seq(T(n), n=0..20); # Alois P. Heinz, Jun 02 2014
MATHEMATICA
b[x_, y_, t_] := b[x, y, t] = If[y<0 || y>x, 0, If[x == 0, 1, Expand[b[x-1, y+1, Min[t+1, 3]]*If[t == 3, z, 1] + b[x-1, y-1, 1] + If[y == 0, b[x-1, 0, 1], 0]]]]; T[n_] := Function[{p}, Table[Coefficient[p, z, i], {i, 0, Exponent[p, z]}]][b[n, 0, 1]]; Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, May 27 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Emeric Deutsch, Jun 07 2011
STATUS
approved