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”).

A156045
Triangle T(n, k) = 2 + n! - k! - (n-k)!, read by rows.
1
1, 1, 1, 1, 2, 1, 1, 5, 5, 1, 1, 19, 22, 19, 1, 1, 97, 114, 114, 97, 1, 1, 601, 696, 710, 696, 601, 1, 1, 4321, 4920, 5012, 5012, 4920, 4321, 1, 1, 35281, 39600, 40196, 40274, 40196, 39600, 35281, 1, 1, 322561, 357840, 362156, 362738, 362738, 362156, 357840, 322561, 1
OFFSET
0,5
COMMENTS
Row sums are: {1, 2, 4, 12, 62, 424, 3306, 28508, 270430, 2810592, 31840994, ...}.
FORMULA
T(n, k) = 2 + n! - k! - (n-k)!.
Sum_{k=0..n} T(n,k) = 2*(n+1) + (n+1)! - 2*!(n+1), where !n = A003422(n). - G. C. Greubel, Dec 02 2019
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 2, 1;
1, 5, 5, 1;
1, 19, 22, 19, 1;
1, 97, 114, 114, 97, 1;
1, 601, 696, 710, 696, 601, 1;
1, 4321, 4920, 5012, 5012, 4920, 4321, 1;
1, 35281, 39600, 40196, 40274, 40196, 39600, 35281, 1;
MAPLE
seq(seq( n! -k! -(n-k)! +2, k=0..n), n=0..10); # G. C. Greubel, Dec 02 2019
MATHEMATICA
Table[n! -k! -(n-k)! +2, {n, 0, 10}, {k, 0, n}]//Flatten
PROG
(PARI) T(n, k) = n! -k! -(n-k)! +2; \\ G. C. Greubel, Dec 02 2019
(Magma) F:=Factorial; [F(n) -F(k) -F(n-k) +2: k in [0..n], n in [0..10]]; // G. C. Greubel, Dec 02 2019
(Sage) f=factorial; [[f(n) -f(k) -f(n-k) +2 for k in (0..n)] for n in (0..10)] # G. C. Greubel, Dec 02 2019
(GAP) F:=Factorial;; Flat(List([0..10], n-> List([0..n], k-> F(n) -F(k) -F(n-k) +2 ))); # G. C. Greubel, Dec 02 2019
CROSSREFS
Sequence in context: A378173 A060854 A091378 * A119687 A086856 A052916
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Feb 02 2009
EXTENSIONS
Edited by G. C. Greubel, Dec 02 2019
STATUS
approved