reviewed
approved
reviewed
approved
proposed
reviewed
editing
proposed
b[n_, k_] := b[n, k] = (k+1)!*Binomial[n, k]*Sum[(-1)^i/i!, {i, 0, k+1}]/n;
T[n_, k_] := T[n, k] = If[k == 0, n!, T[n, k-1] - b[n, n-k+1]];
Table[Table[T[n, k], {k, 0, n - 1}], {n, 1, 10}] // Flatten (* Jean-François Alcover, Mar 06 2022, after Alois P. Heinz *)
approved
editing
editing
approved
editing
approved
T(n,k) = T(n,k-1) - A010027(n,n-k) for k >= 1.
b:= proc(n, k) option remember; (k+1)!*
binomial(n, k)*add((-1)^i/i!, i=0..k+1)/n
end:
T:= proc(n, k) option remember;
`if`(k=0, n!, T(n, k-1)-b(n, n-k+1))
end:
seq(seq(T(n, k), k=0..n-1), n=1..10); # Alois P. Heinz, Aug 11 2021