OFFSET
0,5
LINKS
G. C. Greubel, Rows n = 0..100 of triangle, flattened
FORMULA
T(n,k) = Sum_{j=0..floor((2*n-2*k-1)/2)} binomial(n-j, 2*(n-k-j)). - G. C. Greubel, Sep 27 2019
EXAMPLE
Triangle begins:
1;
1, 1;
1, 2, 1;
1, 2, 4, 1:
1, 2, 5, 7, 1;
1, 2, 5, 12, 11, 1;
1, 2, 5, 13, 26, 16, 1;
...
MAPLE
T:= proc(n, k) option remember;
add( binomial(n-j, 2*(n-k-j)), j=0..floor((2*n - 2*k+1)/2))
end:
seq(seq(T(n, k), k=0..n), n=0..12); # G. C. Greubel, Sep 27 2019
MATHEMATICA
T[n_, k_]:= Sum[Binomial[n-j, 2*(n-k-j)], {j, 0, Floor[(2*n-2*k+1)/2]}]; Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Sep 27 2019 *)
PROG
(PARI) T(n, k) = sum(j=0, (2*n-2*k+1)\2, binomial(n-j, 2*(n-k-j)));
for(n=0, 12, for(k=0, n, print1(T(n, k), ", "))) \\ G. C. Greubel, Sep 27 2019
(Magma) T:= func< n, k | &+[Binomial(n-j, 2*(n-k-j)) : j in [0..Floor((2*n -2*k+1)/2)]] >;
[T(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Sep 27 2019
(Sage) [[ sum(binomial(n-j, 2*(n-k-j)) for j in (0..floor((2*n-2*k+1)/2)) ) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Sep 27 2019
(GAP) Flat(List([0..12], n-> List([0..n], k-> Sum([0..Int((2*n-2*k+1)/2) ], j-> Binomial(n-j, 2*(n-k-j))) ))); # G. C. Greubel, Sep 27 2019
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
STATUS
approved