[Math] Proving properties about the last digits of perfect squares.

elementary-number-theory

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!

Best Answer

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.

Related Question