Fact14.3.1
No number \begin{equation*}n\equiv 5\text{ or }n\equiv 7\text{ (mod }8)\end{equation*} can be written as \(x^2+2y^2\).
Karl-Dieter Crisman
There is yet another generalization that will serve better as a lead-in to the next chapters. Think about the following two problems.
What numbers can be written as \(x^2+2y^2\)? (Think of it as \(x^2+y^2+y^2\).)
What numbers can be written as \(x^2+3y^2\)?
These are very natural generalizations to the “two squares” question. How could we approach them? Here's one type of idea.
No number \begin{equation*}n\equiv 5\text{ or }n\equiv 7\text{ (mod }8)\end{equation*} can be written as \(x^2+2y^2\).
Try all numbers modulo 8 and see what is possible! (See Exercise 14.4.3.)
Already Fermat (unsurprisingly) claimed a partial converse to Fact 14.3.1. He stated that any prime number \(p\) which satisfies \(p\equiv 1\) or \(p\equiv 3\text{ (mod }8)\) could be written as a sum of a square and twice a square.
This time, Euler wasn't the one who proved it! But you could almost imagine that by factoring \begin{equation*}x^2+2y^2=(x-\sqrt{2}iy)(x+\sqrt{2}iy)\end{equation*} you could start proving such things. When might a square root of two exist modulo \(p\) …
Here are some numbers which can be written in this form.
In Exercise 14.4.10, you will try to discover a similar pattern for \(x^2+3y^2\). See also Section 15.4.