OFFSET
0,5
COMMENTS
If the permutation has no second cycle, then its second-longest cycle is defined to have length 0.
LINKS
Alois P. Heinz, Rows n = 0..200, flattened
Steven Finch, Second best, Third worst, Fourth in line, arxiv:2202.07621 [math.CO], 2022.
FORMULA
Sum_{k=0..floor(n/2)} k * T(n,k) = A332851(n). - Alois P. Heinz, Dec 07 2021
EXAMPLE
Triangle begins:
[0] 1;
[1] 1;
[2] 1, 1;
[3] 2, 4;
[4] 6, 15, 3;
[5] 24, 61, 35;
[6] 120, 290, 270, 40;
[7] 720, 1646, 1974, 700;
[8] 5040, 11025, 14707, 8288, 1260;
[9] 40320, 85345, 117459, 90272, 29484;
...
MAPLE
b:= proc(n, l) option remember; `if`(n=0, x^l[1], add((j-1)!*
b(n-j, sort([l[], j])[2..3])*binomial(n-1, j-1), j=1..n))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..n/2))(b(n, [0$2])):
seq(T(n), n=0..12); # Alois P. Heinz, Dec 07 2021
MATHEMATICA
b[n_, l_] := b[n, l] = If[n == 0, x^l[[1]], Sum[(j - 1)!*b[n - j, Sort[ Append[l, j]][[2 ;; 3]]]*Binomial[n - 1, j - 1], {j, 1, n}]];
T[n_] := With[{p = b[n, {0, 0}]}, Table[Coefficient[p, x, i], {i, 0, n/2}]];
Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Dec 28 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Steven Finch, Dec 07 2021
STATUS
approved