2.1: Problem 08: Prove that any number that is a square must have one of the following for its units digit: \(0,1,4,5,6,9\)

Proof

Suppose \(x\) is a square. Then \(x = a^2\) for some \(a \in \mathbb{Z}\). Let \(d\) be the last digit of \(a\). We know \(d \in \{0,1,2,3,4,5,6,7,8,9\}\). We can then compute the square of all the possible values of \(a^2 \bmod 10\) as follows

$$ \begin{align*} 0^2 &\bmod 10 = 0 \\ 1^2 &\bmod 10 = 1 \\ 2^2 &\bmod 10 = 4 \\ 3^2 &\bmod 10 = 9 \\ 4^2 &\bmod 10 = 16 \bmod 10 = 6 \\ 5^2 &\bmod 10 = 25 \bmod 10 = 5 \\ 6^2 &\bmod 10 = 36 \bmod 10 = 6 \\ 7^2 &\bmod 10 = 49 \bmod 10 = 9 \\ 8^2 &\bmod 10 = 64 \bmod 10 = 4 \\ 9^2 &\bmod 10 = 81 \bmod 10 = 1 \end{align*} $$

Therefore, the only possible last digits are 0,1,4,5,6,9. \(\ \blacksquare\)


References