Number of elements $r$ in $R=\mathbb{Z}/2020\mathbb{Z}$ ring such that $r^n=1$ for some integer $n$ where $n \geq 1$ Number of elements $r$ in $R=\mathbb{Z}/2020\mathbb{Z}$ ring such that $r^n=1$ where $n \geq 1$
$\textbf{Solution i tried}$: Here given that $r^n=1$ which means $r*r*r..n \;\;times=1$
it can be written as $r^{n-1}*r=1$ from here we can see that $r$ should be an element of Ring  and should be unit ,
and the total number of units in given ring is $\phi(2020)=800$ so the number of elements in $R$ such that $r^n=1$ is $800$
I want to know that is my solution is right, or there is any other way to solve this.?
Thankyou.
 A: You are correct that if $r^n = 1$ for some $n \in \Bbb N$, then $r$ must be a unit and there are $800$ units.
We now prove the converse. Namely, if $r$ is a unit, then $r^n = 1$ for some $n \in \Bbb N$. (In fact, we can choose $n = 800$ for all units $r$ but I do not prove this.)
All the equalities below are modulo $2020$. (That is, equality in the ring $\Bbb Z/2020\Bbb Z$.)
To see this, note that if $r$ is a unit, then so is $r^n$ for all $n \in \{0, \ldots, 799\}$. (Where $r^0 = 1$.)
Thus, when we look at $$1, r, r^2, \ldots, r^{800},$$ we see that two of them must be equal. (Since all of the above are units and there are only $800$ units in total.)
Thus, there exists $0 \le i < j \le 800$ such that $$r^i = r^j$$ and thus $$r^{j - 1} = 1.$$ Putting $n = j - i > 0 $ gives the result.

The above is part of a more general phenomenon with a similar proof: If $G$ is a finite group and $g \in G$, then there exists $n \in \Bbb N$ such that $g^n = 1$. In this case, the group we were looking at was the group of units of $\Bbb Z/2020\Bbb Z$.
