# Integer solutions to $a^{2}+b^{2}+c^{2} = d^{2}+e^{2}+f^{2}$, where $a, b, c, d, e, f \neq 0$

How does one approach something like this? Is there an equivalent Legendre's three-square theorem for the sum of three squares in two different ways?

It seems like the only way to approach it would be via some computer power.

• No, this is not the only way. There is a lot of literature on sums of squares. Some references are given here, but there is also more specific literature. – Dietrich Burde Dec 20 '17 at 12:28
• Could you point me to some good papers? – Joshua Farrell Dec 20 '17 at 12:30
• Yes, I can. But before it is perhaps worth to point you to some questions at MSE covering this, e.g., this question, with an answer by Tito Piezas III, who has a website with such identities. Also OEIS is helpful. – Dietrich Burde Dec 20 '17 at 12:34
• math.stackexchange.com/questions/1786554/… – individ Dec 20 '17 at 13:00
• This is not so. You can always ask in advance any number of times representations of a number as a sum of 3 squares. At least 2 times. At least 4. Any preassigned number. artofproblemsolving.com/community/… – individ Dec 20 '17 at 13:07

There is a method to find the different primitive representations of an integer $n$ as the sum of three squares, see here. This gives solutions to the above equation. For example, we have $150$ different representations of $n=225=a^2+b^2+c^2$, and $96$ primitive ones among them. So we can choose each pair of these solutions to obtain $$a^2+b^2+c^2=n=d^2+e^2+f^2.$$

When $a = -d, b=-e, c=-f$ then it satisfies the equality.

Consider

$$(-99)^2+(-100)^2+(-101)^2 = (99)^2+(100)^2+(101)^2$$

Similarly

$$(-d)^2+(-e)^2+(-f)^2= d^2+e^2+f^2$$

Where $a≠b≠c≠d≠e≠f$

So infinite integral solutions are possible. (Not positive integral).

Equation:

$$a^2+b^2+c^2=x^2+y^2+z^2$$

You can write a simple solution:

$$a=q^2+s^2+k^2-p^2-t^2$$

$$b=q^2+s^2+k^2-p^2+t^2+2pt-2kt-2st-2qt$$

$$c=q^2+s^2+k^2+p^2-t^2+2tp-2kp-2sp-2qp$$

$$x=p^2+t^2+k^2-q^2-s^2-2kt-2pk+2sk+2qk$$

$$y=p^2+t^2-k^2-q^2+s^2-2ts-2ps+2ks+2qs$$

$$z=p^2+t^2-k^2+q^2-s^2-2tq-2pq+2kq+2sq$$

$p,t,k,q,s$ - any integer asked us.

There are a lot of methods, e.g. matrices are very useful.

But to avoid complicate constructions I will show you an easy way. After some calculations you can imagine how a possible general solution looks like.

We begin with $3$ variables $a,b,c$ . Here '$i$' is the imaginary unit.

$c:=\alpha^2+\beta^2=|\alpha+i\beta|^2=|(\alpha+i\beta)^2|=|\alpha^2-\beta^2+i2\alpha\beta|=\sqrt{(\alpha^2-\beta^2)^2+(2\alpha\beta)^2}$

We get $a^2+b^2=c^2$ with e.g. $a:=\alpha^2-\beta^2$ and $b=2\alpha\beta$ .

We continue with $4$ variables $a,b,c,d$ .

$d:=\alpha^2+\beta^2+\gamma^2=||\alpha+i\beta|+i\gamma|^2=…=\sqrt{(\alpha^2+\beta^2-\gamma^2)^2+(2\alpha\gamma)^2+(2\beta\gamma)^2}$

We get $a^2+b^2+c^2=d^2$ with e.g. $a:=\alpha^2+\beta^2-\gamma^2$ , $b=2\alpha\gamma$ and $c=2\beta\gamma$ .

If we like to have $a^2+b^2-c^2=d^2$ it’s enough to substitute $\beta$ by $i\beta$ .

So, your problem can be started with $f:=\alpha^2+\beta^2+\gamma^2+\delta^2+\epsilon^2=…$ and you will get

a formula for $a^2+b^2+c^2+d^2+e^2=f^2$ . To get $a^2+b^2+c^2-d^2-e^2=f^2$ you only

have to substitute e.g. $\delta$ by $i\delta$ and $\epsilon$ by $i\epsilon$ .