OFFSET
0,5
COMMENTS
Row sums are: 1, 2, 4, 8, 106, 652, 16514, 158482, 5336706, 69403916, 2915603362, ...
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
FORMULA
From G. C. Greubel, Feb 24 2021: (Start)
T(n, k) = (n-k)^n * binomial(n, n-k) for n < 2*k, k^n * binomial(n, k) for n >= 2*k with T(n, 0) = T(n, n) = 1.
T(n, k) = T(n, n-k). (End)
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 2, 1;
1, 3, 3, 1;
1, 4, 96, 4, 1;
1, 5, 320, 320, 5, 1;
1, 6, 960, 14580, 960, 6, 1;
1, 7, 2688, 76545, 76545, 2688, 7, 1;
1, 8, 7168, 367416, 4587520, 367416, 7168, 8, 1;
1, 9, 18432, 1653372, 33030144, 33030144, 1653372, 18432, 9, 1;
1, 10, 46080, 7085880, 220200960, 2460937500, 220200960, 7085880, 46080, 10, 1;
MATHEMATICA
T[n_, k_]:= If[k==0 || k==n, 1, If[n>=2*k, k^n*Binomial[n, k], (n-k)^n*Binomial[n, n-k]]];
Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* modified by G. C. Greubel, Feb 24 2021 *)
PROG
(Sage)
@CachedFunction
def T(n, k):
if (k==0 or k==n): return 1
elif (n > 2*k-1): return k^n*binomial(n, k)
else: return (n-k)^n*binomial(n, n-k)
flatten([[T(n, k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Feb 24 2021
(Magma)
function T(n, k)
if k eq 0 or k eq n then return 1;
elif n lt 2*k then return (n-k)^n*Binomial(n, n-k);
else return k^n*Binomial(n, k);
end if; return T;
end function;
[T(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Feb 24 2021
CROSSREFS
KEYWORD
AUTHOR
Roger L. Bagula and Mats Granvik, Oct 27 2009
EXTENSIONS
Edited by G. C. Greubel, Feb 24 2021
STATUS
approved