eq := z*(t+z-t*z)*G^2-(1-2*z-z^2-z^3+t*z^3)*G+z^2 = 0: G := RootOf(eq, G): Gser := simplify(series(G, z = 0, 25)): for n from 2 to 22 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 2 to 22 do seq(coeff(P[n], t, j), j = 0 .. degree(P[n])) end do; # yields sequence in triangular form
# Alternative:
b:= proc(n, y, t, h) option remember; expand(
`if`(n=0, (1-t), `if`(t<0, 0, b(n-1, y+1, 1, 0)*z^h)+
`if`(t>0 or y<2, 0, b(n, y-1, -1, 0))+
`if`(y<1, 0, b(n-1, y, 0, `if`(t<0, 1, 0)))))
end:
T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(n, 0$3)):