Orders of the elements in the alternating group $A_n$ 
Find all possible orders of the elements in $A_5$

My idea for solving this was showing that:


*

*any $k$-cycle can be written as a product of $k-1$ jointed $2$-cyles, like $(ij)(ik)=(ikj)$, and since the $2$-cycles are all odd permutations, that excludes all $k$-cycles where $k$ is even;

*for permutations which are products of disjointed cycles (which is only possible for two $2$-cycles or a $3$-cycle and a $2$-cycle, of orders $2$ or $6$), show an example for each of why it is/isn't in $A_5$
So my answer would be $\{ 1,2,3,5\}$. The thing is the whole process seems very tedious if we're talking about larger groups. 
For finding the orders of the elements in $A_8$, this implied checking all orders from $1\to 15$, which isn't that hard,  but isn't there another way to do this?
 A: Using generating functions, you can write
$$
\prod_{k=1}^n\left(1+z_k\left(x^ky^{k-1}+\left(x^ky^{k-1}\right)^2+\cdots\right)\right)=\prod_{k=1}^n
\left(1+\frac{z_k}{1-x^{-k}y^{1-k}}\right)
$$
and read off the possible cycle combinations in $A_n$ from the terms with $x^ny^j$ with even $j$. You can set $z_1=1$ since cycles of length $1$ don’t affect the order. For instance, for $n=5$ this calculation yields
$$
x^5\left(1+z_2y^2+z_3y^2+z_5y^4\right)\;,
$$
in agreement with your result. For $n=6$ we get
$$
x^6\left(1+z_2z_4y^4+z_2y^2+z_3y^2+z_3y^4+z_5y^4\right)\;,
$$
so the set of orders in this case is $\{1,2,3,4,5\}$. For $n=8$, Wolfram|Alpha doesn’t play along, but we can do the easy part for the $7$-cycles (which can occur) and the $8$-cycles (which can’t occur) by hand and use the $x^8$ term in the above calculation for the rest:
$$
x^8\left(1+(z_2+z_2z_3+z_2z_4)y^4+z_2z_6y^6+z_2y^2+z_3z_5y^6+z_3y^2+z_3y^4+z_4y^6+z_5y^4\right)\;.
$$
Thus the set of orders in $A_8$ is $\{1,2,3,4,5,6,7,15\}$.
