2. Find the last three digits of $7^{2014}$.

.
Solution 1. We will use the Euler-Fermat theorem: if $\operatorname{gcd} a, m=1$, then

$$
a^{\varphi(m)} \equiv 1 \quad(\operatorname{mod} m)
$$

In our case, we want to calculate $7^{2014}$ (mod 1000). Since $1000=$ $2^{3} 5^{3}$, we have $\varphi(1000)=2^{2}(2-1) \cdot 5^{2}(5-1)=400$. Therefore,

$$
7^{2014}=7^{5 \cdot 400+14}=\left(7^{400}\right)^{5} \cdot 7^{14} \equiv 1^{5} \cdot 7^{14} \equiv 849 \quad(\operatorname{mod} 1000)
$$

Consequently, the last three digits of $7^{2014}$ are 849.