5

I have figured out a (long, and tedious) way to do it. But I was wondering if there is some sort of direct correlation or another path that I completely missed.

My attempt at the program was as follows:

A number of the form, $8k + 7 = 7 (mod 8)$. That is, we are looking for integers a, b, c such that $a^2 + b^2 + c^2 = 7 (mod 8)$.

LONG and TEDIOUS way: $$(8k)^2 = 0 (mod 8)$$ $$(8k+1)^2 = 1 (mod 8)$$ $$(8k+2)^2 = 4 (mod 8)$$ $$(8k+3)^2 = 1 (mod 8)$$ $$(8k+4)^2 = 0 (mod 8)$$ $$(8k+5)^2 = 1 (mod 8)$$ $$(8k+6)^2 = 4 (mod 8)$$ $$(8k+7)^2 = 1 (mod 8)$$

That is, using three of these modulo there is no way to arrive at $$a^2 + b^2 + c^2 = 7 (mod 8)$$

  • 1
    http://www.proofwiki.org/wiki/Integer_as_Sum_of_Three_Squares or http://en.wikipedia.org/wiki/Legendre's_three-square_theorem – lab bhattacharjee May 03 '14 at 16:21
  • 2
    Less tedious for odd cases $$(2n+1)^2=8\frac{n(n+1)}2+1\equiv1\pmod8$$ Even cases: $$0^2\equiv0,(\pm2)^2\equiv4, 4^2\equiv0\pmod 8$$ – lab bhattacharjee May 03 '14 at 16:24
  • Your proof is perfectly correct: an even square is $0$ or $4$ (mod $8$) and an odd square is $1$ (mod $8$). There are several ways to arrive at this conclusion of which yours is one (maybe not the shortest). Once reached, it is obvious that a sum of three squares can't be $7$ (mod $8$), as you correctly deduce. – Geoff Robinson May 03 '14 at 16:31
  • 2
    A bit quicker: First, the square of any odd integer is congruent to $1$ mod $8$, and the square of any even integer is divisible by $4$. For $a^2 + b^2 + c^2$ to be odd, exactly one or three of $a$, $b$, and $c$ must be odd. If all three are odd, the sum mod $8$ is $3$, not $7$. If one is odd, consider the sum mod $4$. It’s $1+0+0$, which can only be $1$ or $5$ mod $8$, not $7$. – Steve Kass May 03 '14 at 18:13

4 Answers4

7

Note that $x^2\equiv (-x)^2\pmod 8$. So the squares mod $8$ are $0^2=0$, $1^2=1$, $2^2=4$ and $3^2=1$. It is evident that three of these numbers cannot add up $7$.

ajotatxe
  • 66,849
5

You get a little bonus: $x^2 + y^2 + z^2$ can be even with two of the variables odd. However, $x^2 + y^2 + z^2$ cannot be divisible by $4$ unless all three of $x,y,z$ are even. So, Assume $x^2 + y^2 + z^2 \equiv 28 \pmod {32}.$ It follows that $x,y,z$ are even, and we get $(x/2)^2 + (y/2)^2 + (z/2)^2 \equiv 7 \pmod 8.$ This is a contradiction, so the sum of three squares cannot be $28 \pmod {32}.$ Do it again, the sum cannot be $112 \pmod {128}.$ And induction...the traditional way to write this is $$ x^2 + y^2 + z^2 \neq 4^k \cdot (8n+7). $$ On the other hand, every other positive integer $m$ can be written as $m=x^2 + y^2 + z^2$ with integer variables. Gauss.

Will Jagy
  • 146,052
0

Note that $$(2m+1)^2=8\frac {m(m+1)}2+1$$ and that $(2m)^2=4m^2$ is divisible by $4$

Mark Bennet
  • 101,769
0

A variation:

Let $n = 8k + 7 = x^2 + y^2 +z^2$.

Then $n \equiv 3 \pmod 4$. Every square is congruent to $0$ or $1$ mod $4$, so $x^2, y^2, z^2 \equiv 1 \pmod 4$ for these numbers to add up to $ 3 \bmod 4$. Then $x, y, z$ are odd.

One checks immediately that $(\pm 3)^2 \equiv 1 \pmod 8, (\pm 1)^2 \equiv 1 \pmod 8$, which accounts for all odd numbers, so $n = x^2 + y^2 +z^2 \equiv 3 \pmod 8$. But this contradicts $n \equiv 7 \pmod 8$.

This is only a speedup up if you think it's faster to reduce mod $4$ to learn that you don't have to calculate $(\pm 2)^2 \bmod 8$ and $4^2 \bmod 4$.