Proving properties about the last digits of perfect squares. We all know that all perfect squares always end in $1, 4, 5, 6, 9$, or an even number of zeroes. And we have also noticed that for a number that ends in $1, 4, 9$ its tens digit will always be even ($2, 4, 6, 8, 0$). If it ends with $6$, its tens digit will be odd ($1, 3, 5, 7, 9$). If it ends with $5$, its tens digit will be $2$.
I think to show that all perfect squares always end in $1, 4, 5, 6, 9$, or even number of zeroes is not too difficult, we can just show all numbers between $1\dots10$. Am I correct? But I am also trying how to prove these facts about its tens digit. I am trying to use the scientific notation to write the number in $n=a_n10^n+a_{n-1}10^{n-1}+\ldots+a_110+a_0$, but I am not sure how to proceed. Is there any way to prove it using basic algebra or modular arithmetic or some other ways?
Thanks in advance!
 A: Hint 1 A perfect square can either be equivalent to $0$ or $1 \pmod 4$
Hint 2 If $2^n \mid N$, then $2^n$ divides the last $n$ digits of $N$
Hint for the last part When is the last digit of a perfect square $5$?
--- Solution ----
If a perfect square ends in $1$ or $9$, then it is equivalent to $1 \pmod 4$ since it is odd. Thus, if the last two digits are $\overline{a1}$ or $\overline{a9}$, then $4 \mid \overline{a0}$ or $4 \mid \overline{a8}$. Thus, $a$ is even.
If a perfect square is even, then it is divisible by $4$. Thus, if it ends in $0, 4,$ or $8$ (the latter is not possible) the tens digit is even. If it ends in $2$ or $6$ (the former is not possible) then the tens digit is odd.
If a perfect square $k^2$ ends in $5$, it is odd and divisible by $5^2$. Similarly to Hint 2, if $5^n \mid k^2$, then $5^n$ divides the last $n$ digits of $k^2$. Thus, the last two digits are either $25$ or $75$. If it ends in $75$, then $(\frac{k}{5})^2 \equiv 3 \pmod 4$, a contradiction to Hint 1. Thus, the last two digits are $25$.
If you're wondering how Hint 2 works, here's why: Suppose $2^n$ is the highest power of $2$ that divides $N$. $N$ can be written as $a * 10^{n} + b$ for non-negative integer $a, b$ and $b < 10^n$. Thus, $2^n \mid a * 10^n + b$ is necessary and sufficient for $2^n \mid b$. The same argument holds for $5$.
A: Consider the following (mod 10)
$$0^2=0,1^2=1,2^2=4,3^2=9,4^2=6,5^2=5,6^2=6,7^2=9,8^2=4,9^2=1$$
Since the tens digit obviously doesn't matter for what the one digit is, these are all the ways that a square can end.
For the question about an even tens digit, just square $(\sum a_i 10^i)^2=a_0^2+2a_0a_1\cdot 10+\cdots$ You have an even number in front of the $10$, which switches to odd when $a_0^2$ has an odd tens digit. For the question about ending in a $5$ causing the $10$'s digit to be a $2$, notice that if $a_0=5$, then the first term is $25$ and the second is $100a_1$ which doesn't effect the tens spot.
A: $(10x\pm1)^2, (10x\pm2)^2$ and $(10x\pm3)^2$ are all of the form $100x^2\pm20ax+a^2$, where $a^2\leqslant9$ will not influence the tens digit, which will always be even, due to the $20ax$ term.
$(10x\pm4)^2=100x^2\pm80x+16$. The $100x^2$ obviously ends in $00$, so it does not influence the last two digits at all. The $80x$ will not influence either the value of the last digit, since it evidently ends in $0$, nor the parity of the tens digit, which will always be odd, since $\dfrac{80}{10}x=8x$ is always even.
$(10x\pm5)^2=100x^2\pm100x+25$, will always end in $25$. Hope this helps.
