Density argument that some large numbers can’t be the sum of two squares

analysisanalytic-number-theorynumber theory

I have encountered a question stating that density arguments can sometimes be employed to prove certain problems have no solutions. It then asks me to use a density argument to prove that there are not enough perfect squares to write any large number as a sum of two squares.

Now I (as far as I am aware) have not had to work with density arguments before. A search on here showed that we can start by proving something in a dense subset, but since I am working with the natural numbers this doesn't seem to be a possibility.

From intuition we know that as we go through the natural numbers the squares get more and more spaced out, and so up to some number n, the proportion of numbers less than or equal to n that are squares decreases. Am I supposed to try and use something like this?

Any suggestion about where to start, what to try, or even a full explanation would be very helpful.

Best Answer

The argument could go roughly as follows:

There are $n^2$ integers between $1$ and $n^2$. For any number in that interval to be the sum of two squares, each square must be one of the $n+1$ sqares $0^2, 1^2, 2^2,\ldots n^2.$

But selecting $2$ of those $n+1$ numbers with possible repetition but not counting order (addition is commutative) yields

$${n+1 \choose 2}+(n+1) = \frac{(n+1)(n+2)}2$$

possible choices, which is less than $n^2$ for big $n$, it's even just "a bit" more than half of $n^2$.

So even if you add all the squares you have, you do not get enough sums that they could be all numbers from $1$ to $n^2$, just a bit more than half of that. That proves that some of those $n^2$ numbers cannot be the sum of $2$ squares.

Since the deficit (numbers that can't be sums of 2 squares) is $n^2-\frac{(n+1)(n+2)}2=\frac12n^2-\frac32n -1$ and thus increasing with $n$, it can't be that only small numbers are not of this form.

Density arguments are often "coarse", they do not often lead to the best possible bounds (in this case every non-negative integer can be the sum of 4 squares, but some are not the sum of 3 squares). But they can be effective to get some kind of result without going deep into intricacies of a problem.

Related Question