Squares with All Odd Digits

From ProofWiki
Jump to navigation Jump to search

Theorem

The only squares whose digits (when written in base $10$ notation) are all odd are $1$ and $9$.


Proof

If $n$ is even, then at least the last digit of $n^2$ is even.

So for $n^2$ to have its digits all odd, $n$ itself must be odd.

We can see immediately that $1 = 1^2$ and $9 = 3^2$ fit the criterion.

Of the other $1$-digit odd integers, we have $5^2 = 25, 7^2 = 49, 9^2 = 81$, all of which have an even digit.


Now, let $n > 10$ be an odd integer.

There are $5$ cases to consider:

  • $n = 10 p + 1$: we have $\paren {10 p + 1}^2 = 100 p^2 + 20 p + 1 = 10 \paren {10 p^2 + 2 p} + 1$.
  • $n = 10 p + 3$: we have $\paren {10 p + 3}^2 = 100 p^2 + 60 p + 9 = 10 \paren {10 p^2 + 6 p} + 9$.
  • $n = 10 p + 5$: we have $\paren {10 p + 5}^2 = 100 p^2 + 100 p + 25 = 10 \paren {10 p^2 + 10 p + 2} + 5$.
  • $n = 10 p + 7$: we have $\paren {10 p + 7}^2 = 100 p^2 + 140 p + 49 = 10 \paren {10 p^2 + 14 p + 4} + 9$.
  • $n = 10 p + 9$: we have $\paren {10 p + 9}^2 = 100 p^2 + 180 p + 81 = 10 \paren {10 p^2 + 18 p + 8} + 1$.


It is clear that in all cases the $10$s digit is even.

So the square of every odd integer greater than $3$ always has at least one even digit.

Hence the result.

$\blacksquare$