Find the last three digits of $2^{2017}$
My approach:
As $125 \times 8=1000$ we have the congruence modulo $$x \equiv 2^{2017}(mod \: 1000)$$ is equivalent to the equations $$x \equiv 2^{2017}(mod \:125) \tag{1}$$ and $$x \equiv 2^{2017}(mod\:8) \tag{2}$$
Clearly from $(2)$ $x=8m$
Now we need to find remainder when $2^{2017}$ is divided by $125$
We have:
$$2^7 \equiv 3(mod \:125)$$
so $$2^{49} \equiv 3^7(mod \:125)\equiv -63(mod \:125)$$
Hence $$2^{50}\equiv -1(mod \:125) \tag{3}$$
From $(3)$ how to find remainder when $2^{2017}$ is divided by $125$?
As @lulu noted in the comments, $2^{50}\equiv-1\bmod{125}$, as well as $2^7\equiv3\bmod{125}$ imply that $$2^{2017}=(2^{50})^{40}\cdot(2^7)^2\cdot2^3\equiv(-1)^{40}\cdot3^2\cdot8\bmod{125}$$$$2^{2017}\equiv72\bmod{125}$$