I've been searching for an answer to this problem and I haven't found any duplicate, but excuse me if that's the case.
I want to find how many elements generate the cyclic group $\mathbb{Z}/p^r\mathbb{Z}$.
I have already proved that for $\mathbb{Z}/p\mathbb{Z}$ there are $\phi(p)=p-1$ generators, because the order of the coprime numbers to $p$ is exactly $p$.
However I am struggling with the cases $\mathbb{Z}/p^r\mathbb{Z}$ and $\mathbb{Z}/p^rq^s\mathbb{Z}$.
I would appreciate a lot if you could help me with this proof.
Thanks in advanced.