How does one prove (the non-trivial direction) that, for $n \in \mathbb{N}$,

$x^2 + y^2 + z^2 = n$ solvable $\iff$ $x^2 + y^2 + z^2 \equiv n\ (m)$ solvable for all $m$?

In particular, is there a weaker assumption (less congruences on the right)?

I am also interested in generalisations. Please, include references.

Thanks!

• I think $x^2+y^2+z^2\equiv-3\pmod m$ is solvable for all $m$, but I know $x^2+y^2+z^2=-3$ is not solvable (in integers). – Gerry Myerson Feb 27 '13 at 2:25
• Thanks! Yes, there are some assumptions. As for the generalisations, I know that Ramanujan investigated $x^2 + y^2 + 10z^2 = n$ and found values where there are solutions to $x^2 + y^2 + 10z^2 \equiv n\ (m)$ for all $m$, but no solution in integers for the given $n$. I am looking for references too. – J.H. Feb 27 '13 at 2:30
• The key search phrases are "Hasse principle" and "local-to-global". – Gerry Myerson Feb 27 '13 at 2:34
• For quadratics, add the condition of solvability in the reals. – André Nicolas Feb 27 '13 at 3:01
• I'd also suggest "Davenport-Cassels lemma" as a search phrase. – Erick Wong Feb 27 '13 at 4:08

Let's see, Gerry is correct, of course, about the Hasse principle. I cannot tell your background, so: The list of the 102 diagonal forms $a x^2 + b y^2 + c z^2$ that do the same thing, with $1 \leq a \leq b \leq c, \gcd(a,b,c) = 1,$ is in the document I called Dickson_Diagonal_1939 at TERNARY. Complete proofs for some of the 102 (including yours) are in that book, Modern Elementary Theory of Numbers, by Leonard Eugene Dickson. The full list of 913 forms $a x^2 + b y^2 + c z^2 + r y z + s z x + t x y,$ or $\langle a,b,c,r,s,t \rangle$ is at the same site in my paper with Kaplansky labelled Kap_Jagy_Schiemann_1997. At the time, 22 out of 913 forms lacked proof. Byeong-Kweon Oh (item 26, Acta Arithmetica) proved 8 more. The latest thing is that Ken Ono's student R. Lemke Oliver (item number 9, Bulletin London M. Soc., turns out his correct last name is Lemke Oliver, no hyphen) has shown that GRH implies the final 14 are regular.

Let's see, there are infinitely many indefinite forms that do this. Indeed, it took quite a bit of effort to show that there were any indefinite ternary forms that were not regular.

Back to positive ternaries, Wai Kiu Chan and Oh have made an industry of forms that have finitely many exceptions. For ternary forms, we must distinguish weak and strong exceptions: the form $x^2 + 4 y^2 + 9 z^2$ represents all eligible numbers except 2, Kap called that a weak exception. The form $2x^2 + 3 y^2 + 5 z^2 + 2 y z + 2 z x$ misses 1 and, indeed, all $4^k,$ so Kap called this a strong exception. That is in my paper, Jagy_1996_Acta_Arithmetica at the same site.

Proofs. The proofs for the 913-14 = 899 are all over. Many are in the document Jagy_Encyclopedia, including those that Kap did not write down anywhere permanent. It is automatic if a form is alone in its genus. The forms in a genus, taken together, represent all eligible numbers. Lists of genera are available at SCHIEMANN_1 and SCHIEMANN_2

EEEEDDDDIIITTTTTTTTT: since Erick Wong mentions the Aubry-Davenport-Cassels technique, I should draw some distinctions between rational representation and integral representation. As Pete L. Clark (item 23, with me, Acta Arithmetica) calls it, the very strong ADC property, that a form represents a number integrally if and only it represents the number rationally, actually happens for only 103 forms. Your, milder, condition, is referred to as regularity. Here is a good one: $x^2 + 2 y^2 + 10 z^2$ is regular, it is on Dickson's list, but it is not ADC.

• Such thoroughly researched answers as this deserve many more votes. – Erick Wong Feb 27 '13 at 7:45

$x^2 + y^2 + z^2 = n$ is solvable over the integers iff $n$ is not of the form $4^t (8k+7)$. If $n = 4^t (8k+7)$, then $x^2 + y^2 + z^2 = n$ is not solvable mod $4^t \times 8$.

• Where does that come from? – vonbrand Feb 27 '13 at 3:13
• It is sometimes called the "three-square theorem." The proof is somewhat hard. – Qiaochu Yuan Feb 27 '13 at 3:18
• Also referred to as the Lagrange theorem, whose proof can be found in A first course in arithmetic by J.P.Serre. – awllower Feb 27 '13 at 8:40