TITLE: Find the last digit of $3^{1999}$
QUESTION [5 upvotes]: Problem: Find the last digit of $3^{1999}$.

My answer is $3$, but the answer sheet says $7$.
Here is what I did:

$3^{1999}=(3^9)^{222}\cdot3$
Using Fermat's Little Theorem: $3^9\equiv1\pmod{10}$
Therefore, $3^{1999}\equiv(3^9)^{222}\cdot3\equiv1^{222}\cdot3\equiv3\pmod{10}$
Therefore, the last digit should be $3$

Where did I go wrong?

REPLY [3 votes]: By Euler's theorem,
$3^4 \equiv 1 \pmod{10}$
$\implies 3^{1996} \equiv 1 \pmod{10}$ [Raising to the power 499]
$\implies 3^{1999} \equiv 27 \pmod{10} \equiv 7 \pmod{10}$
Hence the result.