OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..386
EXAMPLE
a(3) = 10: 123, 122, 133, 132, 121, 323, 321, 113, 223, 213.
MAPLE
g:= proc(n) option remember; add(n^(n-j)*(n-1)!/(n-j)!, j=1..n) end:
b:= proc(n, t) option remember; `if`(n=0, t, add(g(i)*
b(n-i, `if`(i=1, 1, t))*binomial(n-1, i-1), i=1..n))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..23);
MATHEMATICA
g[n_] := g[n] = Sum[n^(n - j)*(n - 1)!/(n - j)!, {j, 1, n}];
b[n_, t_] := b[n, t] = If[n == 0, t, Sum[g[i]*
b[n - i, If[i == 1, 1, t]]*Binomial[n - 1, i - 1], {i, 1, n}]];
a[n_] := b[n, 0];
Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Apr 27 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Dec 15 2021
STATUS
approved