The next to last digit of the square of a natural number is odd. Prove that its last digit is $6$ .

elementary-number-theory

The next to last digit of the square of a natural number is odd. Prove that its last digit is $6$ .
The solution given in the book is as follows:

The last two digits of the square $n$ depends only on the last two digits of $n$ itself. Suppose n has last two digits $a$ and $b$and we have $(10a+b)^2=100a^2+20ab+b^2$ . It is clear that the tens digit of the number $b^2$ must be odd. A case-by-case analysis shows that the units digit must then be equal to $6$.

Well, I didn't get how do they draw the conclusion that "It is clear that the tens digit of the number $b^2$ must be odd. A case-by-case analysis shows that the units digit must then be equal to $6$." I am not quite getting it?

Best Answer

The hypothesis in the problem states that the tens digit of the number must be odd. Let's look at the contribution by each term:

  • $100a^2$ is a multiple of $100$ and thus contributes $0$ to the tens digit.
  • $20ab$ is a multiple of $20$ and thus contributes some even number to the tens digit.
  • This means that in order for the tens digit to be odd, the tens digit of $b^2$ must be odd.

With that established, we look at the perfect squares from $0^2$ to $9^2$, namely $0,1,4,9,16,25,36,49,64,81$. The only ones with odd tens digit are $4^2=16$ and $6^2=36$, so either $b=4$ or $b=6$. Noting that $100a^2$ and $20ab$ contribute nothing to the units digit, we know that the units digit of $(10a+b)^2$ is equal to the units digit of $b^2$, which is $6$ for all possible values of $b$.

Related Question