Sunday 20 August 2023

Sums of three squares

When I turned 62 my daughter Susanna informed me that 62 was the sum of three squares in two different ways: 12 + 52 + 62 and 22 + 32 + 72.

She had looked up this fact with a keyword search such as "Interesting facts about the number 62". I certainly did find that interesting but for 15 years I didn't take the matter any further. I did however know that there was a characterisation of numbers which were representable as the sum of three squares and this characterisation indicated that, while 62 was the smallest example of a number having two representations, it would not be the only such number. In writing this note I researched this question more thoroughly and discovered that very much more is known including asymptotic results on the number of such representations. This note has little information to add to the question but, at least, I hope it will be easy reading.

Recently I observed that 2, 3, 7 were (modulo 8) the negatives of 1, 5, and 6. This "explains" Susanna's fact as an example of the following observations. Given 3 squares a2, b2, and c2 the equation

a2 + b2 + c2 = (m-a)2 + (m-b)2 + (m-c)2

will be true (by elementary algebra) if

m = (2a + 2b + 2c)/3.

If a=1, b=5, c=6 (the first of Susanna's triples) we would have m=8 and then

m-a = 7, m-b = 3, m-c = 2: the second triple.

This gives immediately the existence of many pairs of triples whose sums of squares are equal. For example, with a = 3, b = 4, c = 8, we have m = 10, m-a = 7, m-b = 6, m-c = 2. Therefore 101 is the sum of 9, 16, and 64 as well as the sum of 49, 36 and 4. This trick of obtaining a second triple does not always work. There are some cases where the triple (m-a, m-b, m-c) is the same (to within a rearrangement} as (a, b, c). Such cases are easily seen to be when a, b, c are in arithmetic progresion.

A more serious barrier to the trick producing a second triple is that m might turn out not to be an integer. For example 32 + 62 + 72 = 94. Here m=32/3 and we find that

m-a = 23/3, m-b = 14/3, m-c = 11/3

whose squares do sum to 94 but they are not integers. In this case there is, nevertheless, a second solution, namely the triple (2, 3, 9) whose squares sum to 94. However I do not see a general pattern suggested by these two solutions.