OFFSET
0,8
COMMENTS
FORMULA
T(2n,0) = binomial(2n-2,n-1) (n>=1); T(2n+1,0) = binomial(2n-1,n-2) (n>=1).
T(n,k) = (k+1)T(n-k,0).
G.f.: G(t,z) = (2 - 3z - tz + 2tz^2 + (1-t)z*sqrt(1-4z^2))/((1 - 2z + sqrt(1-4z^2))(1-tz)^2).
EXAMPLE
T(5,3)=4 because we have HHHUD, HHUDH, HUDHH, and UDHHH, where U=(1,1), H=(1,0), and D=(1,-1).
Triangle starts:
1;
0, 1;
1, 0, 1;
0, 2, 0, 1;
2, 0, 3, 0, 1;
1, 4, 0, 4, 0, 1;
6, 2, 6, 0, 5, 0, 1;
MAPLE
q := sqrt(1-4*z^2): G := (2-3*z-t*z+2*t*z^2+(1-t)*z*q)/((1-2*z+q)*(1-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, k), k = 0 .. n) end do; # yields sequence in triangular form
T := proc (n, k) if n < k then 0 elif k = n then 1 elif k = 0 and n = 1 then 0 elif k = 0 and `mod`(n, 2) = 0 then binomial(n-2, (1/2)*n-1) elif k = 0 and `mod`(n, 2) = 1 then binomial(n-2, (1/2)*n-5/2) else (1+k)*T(n-k, 0) end if end proc: for n from 0 to 12 do seq(T(n, k), k = 0 .. n) end do; # yields sequence in triangular form
MATHEMATICA
T[n_, k_] := Which[n < k, 0,
k == n, 1,
k == 0 && n == 1, 0,
k == 0 && Mod[n, 2] == 0, Binomial[n - 2, n/2 - 1],
k == 0 && Mod[n, 2] == 1, Binomial[n - 2, (n - 5)/2],
True, (1 + k)*T[n - k, 0]];
Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, Aug 30 2024, after 2nd Maple program *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Emeric Deutsch, Jun 07 2011
STATUS
approved