Problem: Find the last digit of 31999.
My answer is 3, but the answer sheet says 7.
Here is what I did:
- 31999=(39)222⋅3
- 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?
Answer
Here's a straightforward alternative that does not require Euler's or Fermat's, and only requires noticing that
3^2 \equiv -1 \pmod {10} so that
\begin{align}3^{1999} &= (3^2)^{999}\cdot3\\&\equiv (-1)^{999}\cdot3\pmod{10}\\&\equiv-3\pmod{10}\\&\equiv{7}\pmod{10}\end{align}
No comments:
Post a Comment