OFFSET
0,5
COMMENTS
Row sums are: 1, 2, 8, 20, 82, 448, 3354, 28560, 270510, 2810688, 31841122, ...
LINKS
G. C. Greubel, Rows n = 0..100 of the triangle, flattened
FORMULA
T(n, k) = 2*(n+1 - mod(n, k+1) - mod(n, n-k+1) ) + (n! - k! - (n-k)!).
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 6, 1;
1, 9, 9, 1;
1, 27, 26, 27, 1;
1, 105, 118, 118, 105, 1;
1, 613, 706, 714, 706, 613, 1;
1, 4333, 4930, 5016, 5016, 4930, 4333, 1;
1, 35297, 39610, 40208, 40278, 40208, 39610, 35297, 1;
1, 322577, 357856, 362168, 362742, 362742, 362168, 357856, 322577, 1;
MATHEMATICA
Table[2*(n+1 -Mod[n, k+1] -Mod[n, n-k+1]) + (n! -k! -(n-k)!), {n, 0, 10}, {k, 0, n}]//Flatten
PROG
(Sage) f=factorial; flatten([[2*(n+1 - n%(k+1) - n%(n-k+1)) + (f(n) -f(k) -f(n-k)) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Feb 07 2021
(Magma) F:=Factorial;; [2*(n+1 - n mod (k+1) - n mod (n-k+1)) + (F(n) -F(k) -F(n-k)): k in [0..n], n in [0..12]]; // G. C. Greubel, Feb 07 2021
CROSSREFS
KEYWORD
AUTHOR
Roger L. Bagula, Apr 10 2010
EXTENSIONS
Edited by G. C. Greubel, Feb 07 2021
STATUS
approved