Wednesday, 23 September 2015

elementary number theory - Find the last digit of 31999




Problem: Find the last digit of 31999.




My answer is 3, but the answer sheet says 7.




Here is what I did:




  • 31999=(39)2223

  • 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

real analysis - How to find lim_{hrightarrow 0}frac{sin(ha)}{h}

How to find \lim_{h\rightarrow 0}\frac{\sin(ha)}{h} without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...