In our Mathematical Reasoning class tonight, we discussed this problem:

Can your age in years be written in terms of the difference of two square numbers? If so, what two numbers?

There are at least three mathematical problems contained here:

- Given a specific whole number (0 or a positive integer), attempt to find two square numbers with that number as a difference.
- There is a pattern to the numbers that cannot be represented in this way (assuming that we’re only using real integers). Prove that none of the numbers that follow the pattern can be represented as the difference of two square real integers.
- Prove that all of the other numbers can be so represented.

If you’d like, take some time to work on the first problem. For instance, if your age is 19, it can be represented as \(10^2 – 9^2 = 100 – 81\). Try it for other numbers and see if you can find any patterns.

The odd numbers are the easiest, because the difference of consecutive squares (0, 1, 4, 9, 16, 25, …) has an obvious pattern: 1, 3, 5, 7, 9. Given any odd number, then, it’s fairly trivial to find two squares with that number as the difference. Specifically, subtracting one and dividing by two gives the lower of two consecutive numbers. For instance, for 39, the lower number is \(\frac{39-1}{2}=\frac{38}{2}=19\). We can double-check this: \(20^2-19^2 = 400-361=39\).

The even numbers are a bit more complicated, and interesting.

Let’s call the two numbers we’re going to square \(a\) and \(b\). There are three possibilities:

- Exactly one of \(a\) and \(b\) is odd.
- Both \(a\) and \(b\) are even.
- Both \(a\) and \(b\) are odd.

Note that an odd number squared is always odd, and an even number squared is always even. Thus, in the first case, \(a^2-b^2\) will be odd, since exactly one of {\(a^2\), \(b^2\)} will be odd, and the difference of an odd number and an even number is always odd.

In the second case, let’s rewrite \(a\) as \(2a_1\) and \(b\) as \(2b_1\). This means that \[a^2-b^2 = (2a_1)^2-(2b_1)^2 \\= 4a_1^2 – 4b_1^2 \\= 4(a_1^2-b_1^2)\] Hence, the difference of any two even numbers squared will be a multiple of 4.

Now to the third case. Let’s write \(a\) as \(2a_1-1\) and \(b\) as \(2b_1-1\). This means that \[a^2-b^2=(2a_1-1)^2-(2b_1-1)^2\\=(4a_1^2-4a_1+1)-(4b_1^2-4b_1+1) \\=4a_1^2-4a_1-4b_1^2-4b_1\\=4(a_1^2-a_1-b_1^2-b_1)\] Hence, the difference of any two odd numbers squared will be a multiple of 4.

We now have the answer to the second question above: If a number is even but not divisible by four, it cannot be the difference of two (real, integer) numbers squared. We have also partially answered the third question: If a number is odd, it is straightforward to find two square numbers with that number as the difference.

The remaining whole numbers are divisible by four. To answer the third question, we need to determine whether all multiples of four satisfy the original problem.

Earlier, we looked at the pattern where \(b=a+1\) (that is, where the numbers being squared are consecutive). Let’s look at the pattern where \(b=a+2\). In this case: \[b^2-a^2 = (a+2)^2-a^2\\=a^2+4a+4-a^2\\=4a+4=4(a+1)\] This represents every whole number multiple of 4.

To find the lower number, divide by four and subtract one. For instance, if the number in question is 48, then \(a=\frac{48}{4} – 1=12-1=11\) and \(b=a+2=13\). Let’s verify: \(13^2-11^2 = 169-121 = 48\).

To summarize:

- For odd numbers, subtract one and divide by two to get the lower number. Add one to get the higher number.
- For multiples of four, divide by four and subtract one to get the lower number. Add two to get the higher number.
- Even numbers not divisible by four do not have solutions.

For many numbers, there are multiple solutions; for instance, \(15=4^2-1^2=8^2-7^2\). However, the rules above will generate one solution for every number for which one exists.

**Bonus question to ponder:** What if we allow complex numbers? For instance, \(1^2-i^2=1-(-1)=2\). Are there pairs of complex numbers that solve *all* even numbers not divisible by four?

M_B_SEvery number n is the difference of two squares

A square divided by four is still a square

n=(n+1)²/4-(n-1)²/4

q.e.d.