# Four square Lagrange Theorem.

Today teacher tell us that every natural number is the sum of four positive squares.

and let us this work:

write $747004$ as the sum of $4$ squares.

I'm at high school and don't understand the proof in Wikipedia.

• this is not a easy problem for high school – Luis Felipe Oct 12 '15 at 0:44
• what should I do? – user279365 Oct 12 '15 at 0:45
• pray hahaha, or you can run it on python – Luis Felipe Oct 12 '15 at 0:46
• Not quite correctly stated, every natural number is the sum of four squares, but we need to include $0$ as a square. The only way to write three this way is $$3 = 1 + 1 + 1 + 0$$ – Will Jagy Oct 12 '15 at 0:55
• Wikipedia is problematic, to put it charitably. As for $0$ being a natural number or not, that's a distraction. I would instead say every positive number can be expressed as the sum of four or fewer nonzero squares. The numbers that require the full four nonzero squares are of the form $8k + 7$. – Bob Happ Oct 12 '15 at 21:34

I'm lucky, if you rest $1$ to $747004$ you have a number wich is divisible by $3$ and $1$ is a square

$$747004=1^2+499^2+499^2+499^2$$

Since Geoff Robinson comment, we have: $$747004=444^2+606^2+414^2+106^2$$

• i'm not sure if this is the only way to do it. – Luis Felipe Oct 12 '15 at 0:50
• It certainly isn't the only way. For example, $747004 = 4 \times 186751$, and it's therefore to write $186751$ as a sum of $4$ integer squares, and then multiply each of those integers by $2$ to get $747004$ as a sum of squares of $4$ even integers. – Geoff Robinson Oct 12 '15 at 1:26
• @GeoffRobinson nice observation mate! – Luis Felipe Oct 12 '15 at 1:48

there are 12537 integer quadruples $w \geq x \geq y \geq z \geq 0$ with $w^2 + x^2 + y^2 + z^2 = 747004.$ Since $747004 = 4 \cdot 186751,$ and $186751 \equiv 7 \pmod 8.$ As a result, $747004$ is not the sum of three squares, so there are no quadruples with any zeroes. Here are some form the beginning, middle, and end:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
863      47       5       1
863      43      19       5
863      41      23       5
863      37      29       5
863      35      31       7
863      35      29      13
862      62      10       4
862      60      18       6
862      58      20      14
862      54      30      12
862      52      34      10
862      50      38       4
862      50      28      26
862      46      38      20
862      42      36      30
861      75       7       3
861      69      29       9
861      65      27      27
861      63      33      25
861      61      39      21
861      57      47      15
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
499     499     499       1
499     499     491      89
499     499     461     191
499     499     419     271
499     497     437     245
499     481     421     299
499     475     467     233
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
462     438     430     396
461     443     425     397
461     437     433     395
460     446     422     398
458     452     410     406
457     455     433     379
457     453     411     405
457     441     435     393
455     449     443     377
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=