OFFSET
0,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..451
Wikipedia, Permutation
FORMULA
a(n) = A143947(n,2n).
EXAMPLE
a(0) = 1: the empty permutation.
a(3) = 1: (1)(2)(3).
a(4) = 2: (1)(23)(4), (1)(24)(3).
a(5) = 10: (12)(3)(45), (13)(2)(45), (1)(234)(5), (1)(243)(5), (1)(235)(4),
(1)(253)(4), (145)(2)(3), (154)(2)(3), (1)(24)(35), (1)(25)(34).
MAPLE
b:= proc(n) option remember;
`if`(n=0, 1, expand(b(n-1)*(t-n+x^n)))
end:
a:= n-> coeff(subs(t=n, b(n)), x, 2*n):
seq(a(n), n=0..23);
MATHEMATICA
T[n_] := Module[{t}, CoefficientList[Product[n-k+t^k, {k, 1, n-1}]*t^(n-1), t]];
a[n_] := Switch[n, 0, 1, 1|2, 0, _, T[n][[2 n]]];
Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Oct 03 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jan 02 2024
STATUS
approved