OFFSET
2,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..450
Andrew V. Sills, Integer Partitions Probability Distributions, arXiv:1912.05306 [math.CO], 2019.
Wikipedia, Permutation
FORMULA
a(n) = Sum_{k=0..floor(n/2)} k * A349979(n,k). - Alois P. Heinz, Dec 07 2021
MAPLE
b:= proc(n, l) option remember; `if`(n=0, l[2], add((j-1)!*b(n-j,
sort([l[], j], `>`)[1..2])*binomial(n-1, j-1), j=1..n))
end:
a:= n-> b(n, [0$2]):
seq(a(n), n=2..23);
MATHEMATICA
b[n_, l_] := b[n, l] = If[n == 0, l[[2]], Sum[(j-1)! b[n-j, ReverseSort[ Append[l, j]][[1 ;; 2]]] Binomial[n - 1, j - 1], {j, 1, n}]];
a[n_] := b[n, {0, 0}];
a /@ Range[2, 23] (* Jean-François Alcover, Mar 01 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Feb 26 2020
STATUS
approved