OFFSET
0,3
COMMENTS
An endofunction on [n] is a function from {1,2,...,n} to {1,2,...,n}.
If the mapping has no third component, then its third-smallest component is defined to have size 0.
LINKS
Alois P. Heinz, Rows n = 0..120, flattened
Steven Finch, Second best, Third worst, Fourth in line, arxiv:2202.07621 [math.CO], 2022.
EXAMPLE
Triangle begins:
1;
1;
4;
26, 1;
237, 1, 18;
2789, 31, 135, 170;
40270, 386, 810, 3060, 2130;
689450, 6574, 13545, 36295, 44730, 32949;
...
MAPLE
g:= proc(n) option remember; add(n^(n-j)*(n-1)!/(n-j)!, j=1..n) end:
b:= proc(n, l) option remember; `if`(n=0, x^subs(infinity=0, l)[3],
add(b(n-i, sort([l[], i])[1..3])*g(i)*binomial(n-1, i-1), i=1..n))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, [infinity$3])):
seq(T(n), n=0..12); # Alois P. Heinz, Dec 17 2021
MATHEMATICA
g[n_] := g[n] = Sum[n^(n - j)*(n - 1)!/(n - j)!, {j, 1, n}];
b[n_, l_] := b[n, l] = If[n == 0, x^(l /. Infinity -> 0)[[3]], Sum[b[n - i, Sort[Append[l, i]][[1 ;; 3]]]*g[i]*Binomial[n - 1, i - 1], {i, 1, n}]];
T[n_] := With[{p = b[n, {Infinity, Infinity, Infinity}]}, Table[ Coefficient[p, x, i], {i, 0, Exponent[p, x]}]];
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 12 2021
EXTENSIONS
More terms (two rows) from Alois P. Heinz, Dec 16 2021
STATUS
approved