<s>[INST] Find the last three digits of $17^{102}$. 
Find the last three digits of $17^{102}$.

That is we have to find out $17^{102}\equiv ?\pmod{1000}$.
Now if we solve it through general congruence relation , then the process becomes very difficult , computational and laborious. Again from Euler's theorem , $$17^{\phi(1000)}\equiv 1 \pmod{1000}.$$ But $\phi(1000)=400(>102)$. So it can't help me.
Does there any simplest way to solve this congruence relation easily ?
 [/INST] The units digit of $17^1$ is $7$.
The units digit of $17^2$ is $9$ ($7 \times 7 = 49$).
The units digit of $17^3$ is $3$ ($7 \times 9 = 63$).
The units digit of $17^4$ is $1$ ($7 \times 3 = 21$).
Calculating,
$\; 17^4 = 289 \cdot 289 = (280+9)^2 = 280^2 + 18 \cdot 280 + 81 \equiv$
$\quad\quad\quad 400 + 800 + 600 + 640 + 81 \equiv 521 \pmod{1000}$
Calculating,
$\; 17^{102} \equiv 17^2 \cdot 521^{25} \equiv 289 \cdot (1 + 520)^{25}  \equiv 289 \cdot (1 + 2^3 \cdot 5^1 \cdot 13^1)^{25} \equiv$
$\quad\quad\quad\; \, \; 289 \; \bigr(1 + \binom{25}{1}\,2^3 \cdot 5^1 \cdot 13^1 + \binom{25}{2}\,2^6 \cdot 5^2 \cdot 13^2 + 0\bigr) \equiv$
$\quad\quad\quad\; \, \;  289 \; \bigr(1 + 0 + 0 + 0 \bigr) \equiv 289 \pmod{1000}$
</s>