Counting cyclic subgroups by their generators (source code)

= Counting cyclic subgroups by their generators
{title2=$\#\{H\le G:H\text{ cyclic},\ |H|=m\}=\#\{g:|g|=m\}/\varphi(m)$}

In a finite <group>, a <cyclic subgroup> of order $m$ has exactly $\varphi(m)$ generators, where $\varphi$ is the <Euler totient function>. Each element generates exactly one <cyclic subgroup>, so dividing the number of elements of order $m$ by $\varphi(m)$ counts these subgroups. Include the identity subgroup using $m=1$ and $\varphi(1)=1$. In a <symmetric group>, element counts come from <cycle type> and <order of a group element> is the <least common multiple> of cycle lengths.