Number of permutations of a specific cycle decomposition 
Let $X(n)$ denote number of all permutations of $\left\{1,\ldots,n \right\}$ that have only cycles of even length. Let $Y(n)$ denote number of all permutations of the same set that have only cycles of odd length. Count $X(2n)-Y(2n)$.

I don't know even how to start. I counted this sum for $n=1,2,3$ and it seems that it is always equal to $0$, but it doesn't help with calculating it in general.
 A: The exponential generating function for permutations containing only even cycles is
$$ G_1(z) = 
\exp\left(  \sum_{k\ge 1} \frac{z^{2k}}{2k}  \right) =
\sqrt{ \frac{1}{1-z^2}} = \frac{\sqrt{1-z^2}}{1-z^2}$$
and the one for odd cycles is
$$ G_2(z) = \exp\left( \sum_{k\ge 0} \frac{z^{2k+1}}{2k+1} \right).$$
We are looking for $$(2n)! [z^{2n}] \left(G_1(z)-G_2(z)\right).$$
Now we have
$$G_2(z) = \exp \log \frac{1}{1-z} \exp\left( - \sum_{k\ge 1} \frac{z^{2k}}{2k} \right)
= \frac{1}{1-z} \frac{1}{G_1(z)} =
\frac{1}{1-z}\sqrt{1-z^2}.$$
It follows that
$$ G_1(z) - G_2(z) = \sqrt{1-z^2} \left(\frac{1}{1-z^2} - \frac{1}{1-z}\right)
= - \sqrt{1-z^2} \frac{z}{1-z^2} = -z \frac{\sqrt{1-z^2}}{1-z^2}.$$
Now clearly this last term consists of a term whose series expansion contains only even powers of $z$, multiplied by $z$, hence there are only odd powers of $z,$ the two counts are equal for $2n$ and we are done.
A: In fact we have $X(2n)=Y(2n)=(2n-1)!!^2$. You can count by building the permutation step by step. For a general permutation, there are $2n$ options for mapping the first element, $2n-1$ for mapping the second element, and so on, for a total of $(2n)!$ permutations.
For only even cycles, one option that would close a cycle is excluded for every other element: The first element can't be mapped to itself, so there are only $2n-1$ options for mapping it; whereas the second element (the element the first element was mapped to) can be mapped freely, yielding another factor $2n-1$; then, independent of whether the second element completed a cycle or not, the third element musn't be mapped to the one element that would complete a cycle (either the first or the third), so there are $2n-3$ options for mapping it, and then again $2n-3$ for mapping the fourth, and so on, for a total of $(2n-1)!!^2$.
For only odd cycles, you can either map the first element to itself ($1$ option), and then you have all $2n-1$ options for the second element, or you can map the first element to another element ($2n-1$ options), and then you can map that second element neither to itself, nor to the first element, leaving only $2n-2$ options, for a total of $1\cdot(2n-1)+(2n-1)(2n-2)=(2n-1)^2$. For all subsequent pairs of elements, before choosing those elements the current cycle is either of odd or of even (possibly zero) length, and correspondingly one of the two considerations applies, which both lead to the same number of possibilities for the pair of elements, so again the result is $(2n-1)!!^2$.
