Show that number $n^2$ after division by $8$ can have remains only $0, 1$ or $4$
What is the solution?
Show that number $n^2$ after division by $8$ can have remains only $0, 1$ or $4$
What is the solution?
On
Hint: if you take squares in the set $\{0,1,2,3,4,5,6,7\}$ and take the results modulo $8$, you get $\{0,1,4,1,0,1,4,1\}$.
On
If $n=4k$, $n^2=(4k)^2=16k^2$, so after division by 8, the remainder is 0.
If $n=4k+1$, $n^2=(4k+1)^2=16k^2+8k+1$, so after division by 8, the remainder is 1.
If $n=4k+2$, $n^2=(4k+2)^2=16k^2+16k+4$, so after division by 8, the remainder is 4.
If $n=4k+3$, $n^2=(4k+3)^2=16k^2+24k+8+1$, so after division by 8, the remainder is 1.
Finally, that number n^2 after division by 8 can have remains only 0, 1 or 4.
if $$n\equiv 0,1,2,3,4,5,6,7 \mod 8$$ then we get $$n^2\equiv 0,1,4,1,0,1,4,1 \mod 8$$