TITLE: A question about cyclic groups
QUESTION [5 upvotes]: How does one see that the cyclic group $C_n$ of order $n$ has $\phi(d)$ elements of order $d$ for each divisor $d$ of $n$? 
(where $\phi(d)$ is the Euler totient function)

REPLY [2 votes]: Recall $\:g^{\large i}\:$ has order $\: n/(i,n)\ $ for a generator $\:g\:$ of $\ C_n$
Therefore $\ \ \displaystyle\  \ d\ =\ \frac{n}{(i,n)},\quad\ \ \ \ \ 0 \le i \le n$
$\quad\displaystyle\iff\quad\  (id,\ nd)\ =\ n,\ \ \ \ \ \, 0 \le i \le n$
$\quad\displaystyle\iff\quad \bigg(\frac{i\:d}{n},d\bigg)\ =\ 1,\ \ \ \ \: 0 \le i \le n,\ \ n\ |\ i\:d$
$\quad\displaystyle\iff\quad\ \ \ (\ j,\ d)\ \ =\ \ 1, \ \ \ \  \:0\le j \le d$