Give a proof to the sentence: "The final decimal digit of a perfect square is 0, 1, 4, 5, 6 or 9."
Solution: A integer $n$ can be expressed as $10a+b$, where $a$ and $b$ are positive integers and $b$ is 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9. Here $a$ is the integer obtained by subtracting the final decimal digit of $n$ and dividing by 10. (so $a=(n-b)/10$) Next note that $(10a + b)^2 = 100a^2+20ab+b^2=10(10a^2+2b)+b^2$ so the final decimal digit of $n^2$ is same as the final decimal digit of $b^2$.
I understand until this point but not below: Furthermore, note that the final decimal digit of $b^2$ is the same as final decimal digit of $(10-b)^2 = 100 - 20ab + b^2$. (how did you get this equation?) consequently we cab reduce our proof to the consideration of fix cases.
final digit of:
1) $n$ is 1 or 9 is 1
2) $n$ is 2 o 8 is 4
3) $n$ is 3 or 7 is 9
4) $n$ is 4 or 6 is 6
5) $n$ is 5 is 5
6) $n$ is 0 is 0
THANKS!