login
A146990
Triangle, read by rows, T(n, k) = binomial(n, k) for n < 2 and binomial(n, k) + 2^(n-1) * binomial(n-2, k-1) otherwise.
1
1, 1, 1, 1, 4, 1, 1, 12, 12, 1, 1, 68, 134, 68, 1, 1, 630, 1885, 1885, 630, 1, 1, 7782, 31119, 46676, 31119, 7782, 1, 1, 117656, 588266, 1176525, 1176525, 588266, 117656, 1, 1, 2097160, 12582940, 31457336, 41943110, 31457336, 12582940, 2097160, 1
OFFSET
0,5
COMMENTS
Row sums are: {1, 2, 6, 26, 272, 5032, 124480, 3764896, 134217984, 5509980800, 256000001024, ...}.
FORMULA
T(n, k) = binomial(n, k) for n < 2 and binomial(n, k) + n^(n-1) * binomial(n-2, k-1) otherwise.
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 4, 1;
1, 12, 12, 1;
1, 68, 134, 68, 1;
1, 630, 1885, 1885, 630, 1;
1, 7782, 31119, 46676, 31119, 7782, 1;
MAPLE
seq(seq( `if`(n<2, binomial(n, k), binomial(n, k) + n^(n-1)*binomial(n-2, k-1)), k=0..n), n=0..10); # G. C. Greubel, Jan 09 2020
MATHEMATICA
Table[If[n <2, Binomial[n, m], Binomial[n, m] + n^(n - 1)*Binomial[n - 2, m - 1]], {n, 0, 10}, {m, 0, n}]; Flatten[%]
PROG
(PARI) T(n, k) = if(n<2, binomial(n, k), binomial(n, k) + n^(n-1)*binomial(n-2, k-1) ); \\ G. C. Greubel, Jan 09 2020
(Magma) T:= func< n, k | n lt 2 select Binomial(n, k) else Binomial(n, k) + n^(n-1)*Binomial(n-2, k-1) >;
[T(n, k): k in [0..n], n in [0..10]]; // G. C. Greubel, Jan 09 2020
(Sage)
@CachedFunction
def T(n, k):
if (n<2): return binomial(n, k)
else: return binomial(n, k) + n^(n-1)*binomial(n-2, k-1)
[[T(n, k) for k in (0..n)] for n in (0..10)] # G. C. Greubel, Jan 09 2020
(GAP)
T:= function(n, k)
if n<2 then return Binomial(n, k);
else return Binomial(n, k) + n^(n-1)*Binomial(n-2, k-1);
fi; end;
Flat(List([0..10], n-> List([0..n], k-> T(n, k) ))); # G. C. Greubel, Jan 09 2020
CROSSREFS
Cf. A028262.
Sequence in context: A350745 A111636 A220688 * A051433 A163366 A181145
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Nov 04 2008
EXTENSIONS
Edited by G. C. Greubel, Jan 09 2020
STATUS
approved