Lagrange's 4 square theorem: are there finite integers which require 4 non-zero squares in a unique way?

109 Views Asked by At

I'm just reading about Lagrange's 4-square theorem, and realising that many integers can be expressed as the sum of 3 or fewer non-zero squares (eg 6=4+1+1). Legendre's 3-square theorem states that all numbers which cannot be expressed as the sum of 3 squares are of the from $4^k(8m+7)$, for integer k and m. Some integers are of this form, and thus require 4 squares but can have the sum done in multiple ways (eg 28=25+1+1+1=16+4+4+4).

This left me wondering: what is the set of integers which cannot be expressed as the sum of 3 squares, and have only one way to be expressed as the sum of 4 squares?

Suppose, in the above expression, we let k=0. We are now investigating numbers of the form $8m+7$.

The first several terms in this sequence have a unique summing, but then many other terms have several ways to be expressed as the sum of 4 squares:

7 = 4+1+1+1

15 = 9+4+1+1

23 = 9+9+4+1

31 = 25+4+1+1 = 9+9+9+4

39 = 36+1+1+1 = 25+9+4+1

When $k=1$, most terms seem to have multiple ways to express as the sum of 4 squares.

28 = 25+1+1+1 = 16+4+4+4

60 = 49+9+1+1 = 36+16+4+4

92 = 81+9+1+1 = 49+25+9+9

In general, the larger the number, the more likely there is to be multiple ways of expressing it as the sum of 4 squares.

Thus my question: Are there only finite integers which require 4 squares, and can only be expressed as the sum of 4 squares in a unique way?

Is 23 the largest such number? Or what other numbers are there with this property?