login
A157170
Triangle, read by rows, T(n,k,m) = (m*(n-k)+1)*binomial(n-1, k-1) + (m*k+1)* binomial(n-1, k) + m*k*(n-k)*binomial(n-2, k-1), with m=2.
2
1, 1, 1, 1, 8, 1, 1, 15, 15, 1, 1, 22, 46, 22, 1, 1, 29, 94, 94, 29, 1, 1, 36, 159, 248, 159, 36, 1, 1, 43, 241, 515, 515, 241, 43, 1, 1, 50, 340, 926, 1270, 926, 340, 50, 1, 1, 57, 456, 1512, 2646, 2646, 1512, 456, 57, 1, 1, 64, 589, 2304, 4914, 6272, 4914, 2304, 589, 64, 1
OFFSET
0,5
COMMENTS
Row sums are: {1, 2, 10, 32, 92, 248, 640, 1600, 3904, 9344, 22016, ...}.
FORMULA
T(n,k,m) = (m*(n-k)+1)*binomial(n-1, k-1) + (m*k+1)* binomial(n-1, k) + m*k*(n-k)*binomial(n-2, k-1), with m = 2.
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 8, 1;
1, 15, 15, 1;
1, 22, 46, 22, 1;
1, 29, 94, 94, 29, 1;
1, 36, 159, 248, 159, 36, 1;
1, 43, 241, 515, 515, 241, 43, 1;
1, 50, 340, 926, 1270, 926, 340, 50, 1;
1, 57, 456, 1512, 2646, 2646, 1512, 456, 57, 1;
1, 64, 589, 2304, 4914, 6272, 4914, 2304, 589, 64, 1;
MAPLE
T:= proc(n, k, m) option remember;
if k=0 and n=0 then 1
else (m*(n-k)+1)*binomial(n-1, k-1) + (m*k+1)* binomial(n-1, k) + m*k*(n-k)*binomial(n-2, k-1)
fi; end:
seq(seq(T(n, k, 2), k=0..n), n=0..10); # G. C. Greubel, Nov 29 2019
MATHEMATICA
T[n_, k_, m_]:= If[n==0 && k==0, 1, (m*(n-k)+1)*Binomial[n-1, k-1] + (m*k+1)*Binomial[n-1, k] + m*k*(n-k)*Binomial[n-2, k-1]]; Table[T[n, k, 2], {n, 0, 10}, {k, 0, n}]//Flatten (* modified by G. C. Greubel, Nov 29 2019 *)
PROG
(PARI) T(n, k, m) = (m*(n-k)+1)*binomial(n-1, k-1) + (m*k+1)* binomial(n-1, k) + m*k*(n-k)*binomial(n-2, k-1); \\ G. C. Greubel, Nov 29 2019
(Magma) m:=2; [(m*(n-k)+1)*Binomial(n-1, k-1) + (m*k+1)* Binomial(n-1, k) + m*k*(n-k)*Binomial(n-2, k-1): k in [0..n], n in [0..10]]; // G. C. Greubel, Nov 29 2019
(Sage) m=2; [[(m*(n-k)+1)*binomial(n-1, k-1) + (m*k+1)* binomial(n-1, k) + m*k*(n-k)*binomial(n-2, k-1) for k in (0..n)] for n in [0..10]] # G. C. Greubel, Nov 29 2019
(GAP) m:=2;; Flat(List([0..10], n-> List([0..n], k-> (m*(n-k)+1)*Binomial(n-1, k-1) + (m*k+1)* Binomial(n-1, k) + m*k*(n-k)*Binomial(n-2, k-1) ))); # G. C. Greubel, Nov 29 2019
CROSSREFS
Cf. A157169 (m=1), this sequence (m=2), A157171 (m=3).
Sequence in context: A174301 A174378 A131067 * A143679 A081581 A174125
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Feb 24 2009
EXTENSIONS
Edited by G. C. Greubel, Nov 29 2019
STATUS
approved