Suppose that $G$ is a finite cyclic group and $|G|=n$. If $d \mid n$, then the number of elements of order $d$ in $G$ is $\varphi(d)$.
I'm trying to prove this result, but I'm a bit stuck.
Suppose that $G$ is a finite cyclic group of order $n$, then $G=\langle g\rangle=\{g^0, \dots, g^{n-1}\}$ for some $g \in G$. Suppose now that $d \mid n$. Then there exists exactly one subgroup $H$ with $|H|=d$. Since $G$ is cyclic the subgroup $H$ is cyclic also and so $H=\langle g^{i}\rangle=\{g^0, g^i, \dots, g^{di}\}$ for $0 \le i \le n-1$.
How can I use this to show the wanted result?