Let $D_n$ denote be the dihedral group with $2n$ elements. Let $n = p_1^{e_1}\cdots p_r^{e_r}$. I need to prove that $$l(D_n) = e_1 + \cdots +e_r +1$$ and $$\mathrm{fact}(D_n) = \{C_{p_1},...(e_1\text{ times})...,C_{p_1},...,C_{p_r},...(e_r\text{ times})...,C_{p_r},C_2\},$$ where $l$ is the length of the group and $\text{fact}$ is the set of composition factors of the group as defined when one proves Jordan-Hölder's theorem.
I've tried to find an strategy with low order dihedral groups but maybe there is a good trick for doing this quickly?
The key to solve this problem is to use the following lemma:
This can be shown using the primary cyclic decomposition of a finite abelian group.
For $D_n$ we consider the subgroup of rotations $<r>$ which is normal because $[D_n:<r>] = 2$ and is abelian because is cyclic. This gives us the extra "1" in the length of the group and the $C_2$ factor in the factors of the group.