List all subgroups of the symmetry group of the regular $n$-gon.
If $n$ is prime, there are only $n+1$ subgroups: subgroup of all rotations and $n$ subgroups with $2$ elements (one reflection and rotation by zero degrees).
But if $n$ is composite, there are additional subgroups in the group of rotations, namely rotations by angle $\frac{\pi}{k},\ k|n$. Also there are subgroups containing rotations and reflections, number of which I can't found. I know that $s_\alpha s_\beta=r_{2(\alpha-\beta)}$, where $s_\alpha$ is a reflection by the line inlcined at an angle $\alpha$ to the horizontal axis. So if a subgroup contains $r_\alpha$ and $s_\beta$, it contains their product $s_{\beta - \frac{\alpha}{2}}$.
What is the best way to count all subgroups for each $n$?
Update: I have found an group-theoretic answer at http://ysharifi.wordpress.com/2011/02/17/subgroups-of-dihedral-groups-1/
Later I will post the answer below.