# Find the length and composition factors of $D_n$

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?

Let $G$ be a finite abelian group with $n$ elements and $n = p_1^{e_1}\cdots p_r^{e_r}$. Then $$l(G) = e_1 + \cdots +e_r$$ and $$\mathrm{fact}(G) = \{C_{p_1},...(e_1\text{ times})...,C_{p_1},...,C_{p_r},...(e_r\text{ times})...,C_{p_r}\}.$$
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.