I missed the deadline

Oh hells bells, I missed the deadline for submitting a solution to Monday Math Madness #5. I solved it and forgot about it until it was too late. The problem reads:

Aside from 1 and 9, are there any perfect squares whose digits are all odd? Justify your answer.

Since I missed the deadline, I guess it’s safe to post my solution… under the cut.

Starting the problem, I wrote down the first bunch of square numbers, and I noticed that in the last two digits (the ones place or the tens place), there was always at least at least one digit which was even. So I figured if I could prove that one of the last two digits is always even in every perfect squares (except 1 and 9), we’re set.

To analyze the last two digits, we have to consider the square of a number n. To do this, we break n into its smaller parts: n=100x+10y+1z where y and z are digits from 0 to 9. Similarly, x can be any positive integer.

  • To be clear, to write the number 23421, we see z=1, y=2 and x=234. The z is the “ones” place and the y is the “tens” place.

Now let’s look at n^2. Expanding, we get n^2=10000x^2+2000xy+200xz+100y^2+20yz+z^2.

Clearly the only terms which contribute to the last two digits are 20yz+z^2.

This becomes a problem of testing all possibilities for y and z since each must be one of the digits from 0 to 9. So we simply make a chart!

I used excel, had each cell calculate 20yz+z^2 mod 100, so we could see only the last two digits. And again, as a reminder to make reading the chart easier: the z is the “ones” place and the y is the “tens” place.

Clearly we see that all possible last two digits have an even digit in it. The two exceptions are “01” and “09”. If n=1 or n=3, we get a perfect square which is composed of all odd digits. They are the trivial cases. But if there is a hundreds digit, then we have an even digit in these numbers (e.g. 201 or 509… the even digit is “0”). Q.E.D.

This chart, in essence, goes through and shows the last two digits of every perfect square! And we can see that except for 1 and 9, all perfect squares have an even number in the last two digits!

This is pretty brute force. I bet there’s some elegant number theory method to solving this, but I’m not up to snuff. I forgot all my number theory, remember?



  1. Just wonder about this:
    (a + b)² = a² + 2ab + b²
    Since we are looking for squares with all odd digits we can drop even squares.
    If we say, like you did, that b stands for the one-digit and a for all the rest, there follows that (a+b)² always contains an even digit on the second place. Because: b² is either 01, 09, 25, 49 or 81. a² is always something of the form x00.2ab is always even.
    So the sum of b² and 2ab gives you an even digit in the second place.

  2. Thanks.

    Yup… Simpler… I always tend to get caught up in things… I went one extra digit than I needed…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s