# Is there a theory of “sums-of-squares residues”?

The theory of quadratic residues is long- and well-studied. Recall that, [somewhat simplified] if $x,a,b$ are integers, with $0 \le a < b$, such that $$x \equiv a^2\!\!\!\pmod{b},$$ then we say that $x$ is a quadratic residue modulo $b$.

Extensions have been made (or at least attempted) for higher powers, e.g., cubic residues, quartic residues, etc. Let’s call this the “vertical” direction.

QUESTION: Has anyone tried extending the theory of quadratic residues in the “horizontal” direction, i.e., developing a theory around residues of more than one square?

For example, if $x,a,b,c$ are integers, with $0 \le a \le b < c$, such that $$x \equiv a^2+b^2\!\!\!\pmod{c},$$ then we could say that $x$ is a two-square residue modulo $c$. Extending the thought-experiment a few steps further, the Four-Square Theorem would be equivalent to saying that every integer is a four-square residue modulo every larger integer, etc.

• @JackD'Aurizio: I don't understand your comment. Here's an example: say $$a = c + d^2+e^2$$ where all are integers. Now $a$ is a two-square residue modulo $c$. So how does the Cauchy-Davenport theorem make it any easier [and/or trivial] to characterize $a$ further? – Kieren MacMillan May 16 '16 at 13:54
• I am just saying that the set of non-two-square residues $\pmod{p}$ is empty, so there is no gain in using the concept of two-square-residue. – Jack D'Aurizio May 16 '16 at 14:00
• @JackD'Aurizio: Ah, I see… – Kieren MacMillan May 16 '16 at 14:07
• @JackD'Aurizio: Please post your comment(s) as an answer, so I can accept it and get this question out of the unanswered queue. Thanks! – Kieren MacMillan Jul 21 '17 at 16:30

Such horizontal extension is not really interesting, since every element of $\mathbb{F}_p$ can be represented as a sum of two squares by the Cauchy-Davenport theorem. In particular in $\mathbb{F}_p$ the subset of elements that cannot be represented as the sum of two squares is empty.