If the last 3 digits of $2012^m$ and $2012^n$ are identical, find the smallest possible value of $m+n$. 
Let $m$ and $n$ be positive integers such that $m>n$. If the last 3 digits of $2012^m$ and $2012^n$ are identical, find the smallest possible value of $m+n$. 

Since the 100's digit is 0 in both cases, I just did $2012^m \equiv 2012^n \mod 1000$, and got $12^m \equiv 12^n\mod 1000$ but I'm not sure where to go from there. Trying to compute the first few powers of $12$ will only get the numbers larger and the pattern doesn't seem to emerge that soon.
 A: You have $12^m\equiv 12^n\pmod{10^3}$ hence $12^m\equiv 12^n\pmod{2^3}$ and $12^m\equiv 12^n\pmod{5^3}$.
For the latter, we have $12^{m-n}\equiv 1\pmod{5^3}$, hence $m\equiv n\pmod{100}$ because the multiplicative order of $12$  modulo $5^3$ is $100$, as computed here.
On the other hand, $12^n(12^{m-n}-1)\equiv 0\pmod{2^3}$ from which $12^n\equiv 0\pmod{2^3}$ which holds for $n\geq 2$.
Thus $n=2$ and $m=102$ is the smallest solution with sum $m+n=104$.
A: As $12^{m-n}-1$ is odd, $2^3$ must divide $12^n\implies n\ge2$
As $(12^n,5)=1,5^3$ must divide $12^{m-n}-1$
$\iff12^{m-n}\equiv1\pmod{125}$
As $12^2\not\equiv1\pmod5\implies$ord$_512=4$
Now $12^4=(145-1)^2\not\equiv1\pmod{25}\implies$ord$_{25}12=4\cdot5$
So, $12$ is a primitive root $\pmod{5^r},r\ge1$
$\implies m-n$ must be divisible by $\phi(125)$
Reference: 
If $g$ is a primitive root of $p^2$ where $p$ is an odd prime, why is $g$ a primitive root of $p^k$ for any $k \geq 1$? 
Here Order of numbers modulo $p^2$ 
 I've proved if ord$_pa=d,$ord$_{p^2}a=d$ or $pd$
A: We have
$$
12^n \equiv 12^{n+100}\Rightarrow n=2,m=102\to n+m=104
$$
