OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..404
FORMULA
EXAMPLE
For n=0, there is no matching which has at least one person matched with their original partner.
For n=1, there are only 2 people, so there is only one way to match them and it is with their original partner.
For n=2, we have two couples, A0 with A1, and B0 with B1. Of the three ways to match them [(A0,A1),(B0,B1)], [(A0,B0),(A1,B1)] and [(A0,B1),(A1,B0)], only the first matching has a person matched up with their original partner.
MAPLE
a:= proc(n) option remember; `if`(n<3, signum(n),
(4*n-7)*a(n-1)-2*(2*n^2-10*n+11)*a(n-2)-2*(n-2)*(2*n-5)*a(n-3))
end:
seq(a(n), n=0..20); # Alois P. Heinz, Feb 14 2024
MATHEMATICA
a[n_] := Sum[(-1)^(n-i+1)*Binomial[n, i]*(2i-1)!!, {i, 0, n-1}];
Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Feb 29 2024 *)
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Sam Coutteau, Feb 13 2024
STATUS
approved