login
A128890
Triangle T(n,k) related to walks in the positive quadrant.
1
1, 0, 1, 2, 0, 1, 0, 5, 0, 1, 10, 0, 9, 0, 1, 0, 35, 0, 14, 0, 1, 70, 0, 84, 0, 20, 0, 1, 0, 294, 0, 168, 0, 27, 0, 1, 588, 0, 840, 0, 300, 0, 35, 0, 1, 0, 2772, 0, 1980, 0, 495, 0, 44, 0, 1
OFFSET
0,4
FORMULA
T(n,k) = binomial(n, r)*binomial(n+2, s) - binomial(n+2, r+1)*binomial(n, s-1) with r=(n+k)/2 and s=(n-k)/2, if n+k is even otherwise T(n,k)=0. Also T(2*n,0) = A000108(n)*A000108(n+1) = A005568(n).
EXAMPLE
Triangle begins:
1;
0, 1;
2, 0, 1;
0, 5, 0, 1;
10, 0, 9, 0, 1;
0, 35, 0, 14, 0, 1;
70, 0, 84, 0, 20, 0, 1;
0, 294, 0, 168, 0, 27, 0, 1;
588, 0, 840, 0, 300, 0, 35, 0, 1;
0, 2772, 0, 1980, 0, 495, 0, 44, 0, 1;
MATHEMATICA
T[n_, k_]:= If[k==0 && EvenQ[n], 4*Binomial[n, n/2]*Binomial[n+2, (n+2)/2 ]/((n+2)*(n+4)), If[EvenQ[n+k], Binomial[n, (n+k)/2]*Binomial[n+2, (n - k)/2] - Binomial[n+2, (n+k+2)/2]*Binomial[n, (n-k-2)/2], 0]];
Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten
PROG
(PARI) { T(n, k) = if(k==0 && n%2==0, 4*binomial(n, n/2)*binomial(n+2, (n+2)/2)/((n+2)*(n+4)), if((n+k)%2==0, binomial(n, (n+k)/2)*binomial(n + 2, (n-k)/2) - binomial(n+2, (n+k+2)/2)*binomial(n, (n-k-2)/2), 0)) }; \\ G. C. Greubel, May 20 2019
(Sage)
def T(n, k):
if (k==0 and n%2==0): return 4*binomial(n, n/2)*binomial(n+2, (n+2)/2)/((n+2)*(n+4))
elif ((n+k)%2==0): return binomial(n, (n+k)/2)*binomial(n + 2, (n-k)/2) - binomial(n+2, (n+k+2)/2)*binomial(n, (n-k-2)/2)
else: return 0
[[T(n, k) for k in (0..n)] for n in (0..10)] # G. C. Greubel, May 20 2019
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Philippe Deléham, Apr 20 2007
STATUS
approved