OFFSET
1,4
LINKS
G. C. Greubel, Rows n = 1..50 of the triangle, flattened
FORMULA
T(n, k) = (n-k)*(n-k)! if k < n, otherwise T(n,n) = 1.
T(n, 1) = A094258(n) = (n-1)!(n-1).
Sum_{k=1..n} T(n, k) = A000142(n) (row sums).
Sum_{k=1..n} k*T(n,k) = Sum_{j=1..n} j! = A007489(n).
Sum_{k=1..floor((n+1)/2)} T(n-k+1, k) = A005165(n). - G. C. Greubel, May 18 2024
EXAMPLE
T(4,2)=4 because we have 1243, 2314, 3412, and 3421.
Triangle starts:
1;
1, 1;
4, 1, 1;
18, 4, 1, 1;
96, 18, 4, 1, 1;
600, 96, 18, 4, 1, 1;
4320, 600, 96, 18, 4, 1, 1;
35280, 4320, 600, 96, 18, 4, 1, 1;
MAPLE
T := proc (n, k) if k = n then 1 elif k < n then factorial(n-k)*(n-k) else 0 end if end proc: for n to 11 do seq(T(n, k), k = 1 .. n) end do; # yields sequence in triangular form
MATHEMATICA
T[n_, k_]:= (n-k+1)! -(n-k)! +Boole[k==n];
Table[T[n, k], {n, 12}, {k, n}]//Flatten (* G. C. Greubel, May 18 2024 *)
PROG
(Magma)
A177262:= func< n, k | k eq n select 1 else (n-k)*Factorial(n-k) >;
[A177262(n, k): k in [1..n], n in [1..12]]; // G. C. Greubel, May 18 2024
(SageMath)
def A177262(n, k): return (n-k)*factorial(n-k) + int(k==n)
flatten([[A177262(n, k) for k in range(1, n+1)] for n in range(1, 13)]) # G. C. Greubel, May 18 2024
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Emeric Deutsch, May 15 2010
STATUS
approved