# 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.
{"ft_lang_label":"__label__en","ft_lang_prob":0.88343865,"math_prob":0.99999464,"size":546,"snap":"2019-26-2019-30","text_gpt3_token_len":188,"char_repetition_ratio":0.11070111,"word_repetition_ratio":0.0,"special_character_ratio":0.37179488,"punctuation_ratio":0.21774194,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":1.0000062,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-07-17T13:12:17Z\",\"WARC-Record-ID\":\"<urn:uuid:fb943562-772e-472c-af93-3a058e4eae02>\",\"Content-Length\":\"139661\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:333938d5-ef55-4c08-93aa-50456b9f92a4>\",\"WARC-Concurrent-To\":\"<urn:uuid:c23e41c2-3522-40d0-8847-2fc2dc879521>\",\"WARC-IP-Address\":\"151.101.65.69\",\"WARC-Target-URI\":\"https://math.stackexchange.com/questions/1898526/find-the-length-and-composition-factors-of-d-n\",\"WARC-Payload-Digest\":\"sha1:KPTEINL6Q6AWGTD65C46GFSTIIJ2KSJT\",\"WARC-Block-Digest\":\"sha1:IV7G6DUXN3MWDE7FGU4Z4L6UMMA4BL54\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-30/CC-MAIN-2019-30_segments_1563195525187.9_warc_CC-MAIN-20190717121559-20190717143559-00157.warc.gz\"}"}