<s>[INST] 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.
 [/INST] 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.
</s>