How can i get the least $n $ such that $17^n \equiv 1 \mod(100$)? When I solve the problem:
$17^{2018}\equiv r \pmod{100} $
used Euler theorem since $\gcd (17,100)=1$ and so
$\phi(100)=40$ 
and so
$17^{40}\equiv 1 \pmod{100}$
But i also found that:  $17^{20}\equiv 1 \pmod{100}$
How can i get the least n such that $17^{n}=1\pmod{100} $?
Is there any theorm or generalization to this problem? 
Thanks for your help 

As $7^1\equiv7,\cdots,7^4\equiv1\pmod{10}$
$4$ must divide $n$
Let $n=4m$
$17^n=(290-1)^{2m}$
$=(1-290)^{2m}\equiv1-\binom{2m}1290\pmod{100}$
So,$100$ must divide $290\cdot2m$
