OFFSET
0,3
LINKS
G. C. Greubel, Rows n = 0..100 of triangle, flattened
FORMULA
Sum_{k=0..n} T(n, k) = (2*k+1)!! = (2*k+1)*(2*k-1)*(2*k-3)*...
EXAMPLE
Triangle begins:
1;
1, 2;
1, 10 4;
1, 44, 44, 16;
1, 182, 440, 216, 106;
MAPLE
T:=proc(n, k) if k=0 then 1 elif n=k then 1+(2*k)!/(k!*2^k) elif k>n then 0 else 2*(n-k)*T(n-1, k-1)+(2*k+2)*T(n-1, k) fi end: for n from 0 to 9 do [seq(T(n, k), k=0..n)] od;
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==0, 1, If[k==n, (2*n-1)!! +1, 2*(n-k)*T[n-1, k-1] + 2*(k+1)*T[n-1, k]]]; Table[T[n, k], {n, 0, 9}, {k, 0, n}]//Flatten (* G. C. Greubel, Sep 03 2019 *)
PROG
(PARI) T(n, k) = if(k==0, 1, if(k==n, (2*n)!/(2^n*n!) + 1, 2*(n-k)*T(n-1, k-1) + 2*(k+1)*T(n-1, k)));
for(n=0, 9, for(k=0, n, print1(T(n, k), ", "))) \\ G. C. Greubel, Sep 03 2019
(Sage)
def T(n, k):
if (k==0): return 1
elif (k==n): return factorial(2*n)/(2^n*factorial(n)) + 1
else: return 2*(k+1)*T(n-1, k) + 2*(n-k)* T(n-1, k-1)
[[T(n, k) for k in (0..n)] for n in (0..9)] # G. C. Greubel, Sep 03 2019
(GAP)
T:= function(n, k)
if k=0 then return 1;
elif k=n then return Factorial(2*n)/(2^n*Factorial(n)) + 1;
else return 2*(n-k)*T(n-1, k-1) + 2*(k+1)*T(n-1, k);
fi;
end;
Flat(List([0..9], n-> List([0..n], k-> T(n, k) ))); # G. C. Greubel, Sep 03 2019
CROSSREFS
KEYWORD
AUTHOR
Miklos Kristof, Nov 11 2004
EXTENSIONS
Name corrected by G. C. Greubel, Sep 04 2019
STATUS
approved