login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A167040
Triangle 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, read by rows.
1
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
OFFSET
0,5
COMMENTS
Row sums are: 1, 2, 4, 8, 106, 652, 16514, 158482, 5336706, 69403916, 2915603362, ...
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
Sequence in context: A143199 A137896 A157219 * A054450 A344610 A337009
KEYWORD
nonn,tabl,easy
AUTHOR
Roger L. Bagula and Mats Granvik, Oct 27 2009
EXTENSIONS
Edited by G. C. Greubel, Feb 24 2021
STATUS
approved