Consider the two calculations \[23=12^2-11^2 \qquad \textrm{and} \qquad 27=14^2-13^2.\]

What makes these two calculations interesting to you?

These two calculations interest me for several reasons. Both calculations express an integer as the difference of two perfect squares. Now, whilst it is clear to me that this should be possible it makes me wonder how I might go about writing other numbers in this way and whether it is possible to write every positive integer in this way. I then notice something quite nice about the numbers chosen. I notice that in the calculation \(23=12^2-11^2\) the numbers \(12\) and \(11\) sum to \(23\). The same thing happens with \(27=14^2-13^2\), which is neat. This leads me to wonder whether I can write another number, say \(28\), in this way using two successive perfect squares.

If I consider \(28\), I want to just try out some numbers to see if I can make it work. Perhaps I start with \(6^2\) since this is the next perfect square. But \(6^2 =36\) so I need to subtract \(8\) to obtain \(28\) and \(8\) is not a perfect square, nor is it \(5^2\) which is what I require if I am trying to write \(28\) as the difference of two successive perfect squares.

Next I try \(7^2\) but I encounter the same problem as I would need to subtract \(21\) which is not a perfect square and is not equal to \(6^2\) as required for this particular problem.

I have a sense that I could keep trying numbers but that I need to have a better system. Since I know that I am looking for two successive perfect squares I could begin by assuming that it is possible and write \(28=n^2 - (n-1)^2\) where \(n\) is an integer. Expanding the right-hand side gives me \(n^2 - n^2 + 2n -1=2n-1\). So I require that \(28=2n-1\) where \(n\) is an integer. But this is not possible so I have to conclude that I cannot write \(28\) as the difference of two successive perfect squares.

You might like to consider how I know that an integer solution to \(28=2n-1\) cannot be found.

How many of the numbers from \(1\) to \(20\) can you express as the difference of two successive perfect squares?

To answer this I use my findings from above. If I want to write any integer \(a\) as the difference of two successive perfect squares I require that \(a=2n-1\) with \(n\) also being an integer. Thus the only numbers I can conceivably write in this form are odd. Also, I know that I can write every odd number as the difference of two successive perfect squares because \(2n-1=n^2-(n-1)^2\).

How many of the numbers from \(1\) to \(20\) can you express as the difference of two perfect squares?

I realise that this is a different question. There will be numbers that can written as the difference of two non-successive perfect squares. For example I can write down that \(8=3^2-1^2\). The interesting question this time is which integers can / cannot be written in this way and why?

I find it hard to think about this question in general without being tempted to start listing square numbers and testing them out (even though I know that’s not an efficient approach). So instead it may be more sensible to think about other ways of expressing it. I know that I want \(a=b^2-c^2\) with \(a, b, c\) being positive integers. I recognise that I can factorise the right-hand side as \((b-c)(b+c)\). This is a more useful form as I can now start considering pairs of factors of my starting number \(a\).

For example, \(8\) can be written as \(1 \times 8\) or \(2 \times 4\) so I now consider whether these pairs could be written in the form \((b-c) \times (b+c)\). For this particular example, \(2 \times 4 = (3-1)(3+1)\) giving the calculation found above \(8=3^2-1^2\). However, \(1 \times 8\) doesn’t work as I cannot find integer values for \(b\) and \(c\) for which \(b-c=1\) and \(b+c=8\).

Therefore \(8\) can be expressed as the difference of two perfect squares, \(3^2\) and \(1^2\).

How many of the numbers from \(1\) to \(20\) can you express as the difference of two perfect squares in more than one way?

I sense that the answer to this question lies in the approach above where I considered the factor pairs of my starting number \(a\) and whether these can be expressed in the form \((b-c)(b+c)\).