I am having a hard time simplifying the problem below. This is a practice problem from my text book. The book did not explain the concept enough so I am having trouble.
Problem:
$8^{202}$ mod 10
I am having a hard time simplifying the problem below. This is a practice problem from my text book. The book did not explain the concept enough so I am having trouble.
Problem:
$8^{202}$ mod 10
On
$$8\equiv-2,8^2\equiv(-2)^2\equiv4,8^3\equiv(-2)4\equiv2,8^4\equiv(4)^2\equiv6\pmod{10}$$
$$202\equiv2\pmod4\implies 8^{202}\equiv8^2\equiv?$$
Alternatively,
as $(8,10)=2,$ let use start with $8^{201}\pmod{\dfrac{10}2}$
$8\equiv3,8^2\equiv-1,8^4\equiv1\pmod5$ (which is also available from Fermat's Little Theorem )
As $201\equiv1\pmod4,8^{201}\equiv8^1\pmod5\equiv3$
$\implies8^{202}\equiv8\cdot3\pmod{8\cdot5}\equiv24\pmod{40}\equiv24\pmod{10}\equiv4$
See Property $\#9$ of this
On
Hint $\,\ {\rm mod}\ 5\!:\ \color{#c00}{8^2\equiv -1}\ $ so $\ x := 8^{4n+2}\equiv (\color{#c00}{8^2})^{2n+1}\equiv (\color{#c00}{-1})^{2n+1}\equiv -1\equiv \color{#0a0}4$
Thus, mod $\,10\!:\ x\equiv \color{#0a0}4\,$ or $\,\color{#0a0}4+5.\,$ It must be $\,x\equiv 4\,$ since $\,x\,$ is even. $ \ $ QED
This would be the last digit of $8^{202}$. Essentially it asks for the remainder when the number is divided by $10$ in this case. All numbers which leave the same remainder would be considered equivalent to each other.
Here note that $8^1=8, 8^2=4, 8^3=2, 8^4=6, 8^5=8, ...$ all mod $10$. You can notice a pattern soon enough and conclude. Also each time, all you need to worry is the last digit, you don't have to multiply the whole number.