## Numbers that are the sum of three nonzero squares

Legendre’s three-square theorem states that a natural number can be represented as the sum of three squares of integers

$N \; = \; x^2 \; + \; y^2 \; + \; z^2$

if and only if   $N$   is not of the form    $N \; = \; 4^{a} \; (8 \, b \; + \; 7)$

for integers   $a$   and   $b$

$m$   and   $n$   are integers that are the sum of three nonzero squares :

$m \; = \; a^2_1 \; + \; a^2_2 \; + \; a^2_3$
$n \; = \; b^2_1 \; + \; b^2_2 \; + \; b^2_3$

do not imply that    $m \cdot n \; = \; c^2_1 \; + \; c^2_2 \; + \; c^2_3$

Here are the first few counterexamples:

$3 \; = \; 1^2 + 1^2 + 1^2$
$6 \; = \; 1^2 + 1^2 + 2^2$

$9 \; = \; 1^2 + 2^2 + 2^2$

$11 \; = \; 1^2 + 1^2 + 3^2$
$12 \; = \; 2^2 + 2^2 + 2^2$
$17 \; = \; 2^2 + 2^2 + 3^2$
$18 \; = \; 1^2 + 1^2 + 4^2$
$19 \; = \; 1^2 + 3^2 + 3^2$

$27 \; = \; 3 \times 9 \; = \; 1^2 + 1^2 + 5^2 \; = \; 3^2 + 3^2 + 3^2$
$33 \; = \; 3 \times 11 \; = \; 2^2 + 2^2 + 5^2 \; = \; 1^2 + 4^2 + 4^2$

$66 \; = \; 6 \times 11$
$66 \; = \; 8^2 + 1^2 + 1^2$
$66 \; = \; 7^2 + 4^2 + 1^2$
$66 \; = \; 5^2 + 5^2 + 4^2$

$187 \; = \; 11 \times 17$
$187 \; = \; 13^2 + 3^2 + 3^2$
$187 \; = \; 9^2 + 9^2 + 5^2$

$209 \; = \; 11 \times 19$
$209 \; = \; 14^2 + 3^2 + 2^2$
$209 \; = \; 13^2 + 6^2 + 2^2$
$209 \; = \; 12^2 + 8^2 + 1^2$
$209 \; = \; 12^2 + 7^2 + 4^2$
$209 \; = \; 10^2 + 10^2 + 3^2$
$209 \; = \; 9^2 + 8^2 + 8^2$