Sunday, 8 March 2026

Exercise (5.2).3

Find the last digit of $7^{2014}$.


We remind ourselves of Euler's Theorm (5.14), which states that for $n>1$ and $\gcd(n.a)=1$, then

$$ a^{\phi(n)} \equiv 1 \pmod n $$


Since $\gcd(10,7)=1$ we have

$$ 7^{\phi(10)} \equiv 1 \pmod {10} $$

That is

$$ 7^{4} \equiv 1 \pmod {10} $$

Using $2014 = 4(503)+2$, we have

$$ \begin{align} 7^{2014} & \equiv (7^4)^{503} \times 7^2 \pmod {10} \\ \\ & \equiv 1 \times 49 \pmod {10} \\ \\ & \equiv 9 \pmod {10} \end{align} $$

And so the last digit of $7^{2014}$ is 9.