# Is $a^2 + b^2 = c^2 + d^2 = e^2 + f^2$ possible, where a+e=d and b+c=f

Here's my problem:

Is $a^2 + b^2 = c^2 + d^2 = e^2 + f^2$ possible where $a$, $b$, $c$, $d$, $e$, and $f$ are all positive integers, and $(a, b)$, $(c, d)$, $(e, f)$ are all distinct pairs ($(3, 4)$ and $(4, 3)$ are same)? I'm not sure if this is a theorem or not, so please let me know the name of the theorem if it is.

Edit: Will this still work if a+e=d and b+c=f?

Thanks for the help!

• If you search the site you will find threads with formulas for the number of ways an integer can be written as a sum of two squares. To get examples all you need to do is to find an $n$ that can be written in at least three ways. – Jyrki Lahtonen Mar 17 '18 at 6:50
• For example: $$|(4+i)(3+2i)(2+i)|^2=|(4+i)(3-2i)(2+i)|^2=|(4+i)(3+2i)(2-i)|^2$$ implies that $$9^2+32^2=33^2+4^2=31^2+12^2.$$ – Jyrki Lahtonen Mar 17 '18 at 6:54
• Thanks for the help! – staticvoid Mar 17 '18 at 6:59
• Re: the new variant. I don't get it. If $a,b,c,d,e,f$ are all positive, then $e=c+a>a$ and $f=b+d>b$. Consequently $e^2+f^2>a^2+b^2$. – Jyrki Lahtonen Mar 17 '18 at 7:46
• Gosh I'm not awake right now. It's a+e=d and b+c=f. What am I doing. – staticvoid Mar 17 '18 at 7:51

Answering the version with the two linear equations added to the system.

Consider the three complex numbers $$z_1=b+ai,\quad z_2=c-di,\quad z_3=f-ei.$$ The quadratic equations imply that $$|z_1|=|z_2|=|z_3|.$$ The linear equations imply that $$z_1+z_2=z_3.$$ So $z_1+z_2=z_3$ has the same length as both $z_1$ and $z_2$. By the law of cosines this implies that the angle between $z_1$ and $z_2$ must be $2\pi/3$.

Let's introduce the ratio $$\omega=\frac{z_1}{z_2}.\qquad(*)$$ We have seen that $|\omega|=1$ and that the argument of $\omega$ is $\pm2\pi/3$. Therefore $$\omega=\frac{-1\pm i\sqrt3}2.$$ But, by $(*)$, $\omega$ should also be an element of the field $\Bbb{Q}(i)$. This is a contradiction.

There are no (non-trivial) integer solutions to the system of the three quadratic and two linear equations. Positive or not.

• Thanks for the solution! This is actually the key to a problem I was trying, which was "Why is it impossible for all three coordinates of an equilateral triangle to be on grid points?" I'll look into this further. – staticvoid Mar 17 '18 at 8:39
• @staticvoid Glad to help. The point was that the imaginary part of $z_1/z_2$ is necessarily rational, but the imaginary part of $\omega$ is not due to that $\sqrt3$. – Jyrki Lahtonen Mar 17 '18 at 16:56

Just look for an example. $(7,1),(1,7),(5,5)$ will work, for example.

Note that $2=1^2+1^2$ and that a prime $p$ of the form $4n+1$ can be written as a sum of integer squares in essentially one way. eg $5=1^2+2^2, 13=2^2+3^2$. On your method of counting these become two ways.

Then note also that $$(a^2+b^2)(c^2+d^2)=(ac-bd)^2+(ad+bc)^2$$ by simple computation. This is related to $(a+ib)(c+id)=(ac-bd)+i(ad+bc)$ where $i^2=-1$, and that observation enables us to draw on deeper mathematical structure. But for the moment the simple observation is enough.

So, for example, we get $65=5\times 13=1+64=49+16$ by pairing the decomposition differently. That counts as four examples on your counting. Then introduce another factor (eg another $5$, or $17$) and you can continue to build examples where you have as many pairs of squares as you like.

Further examples come once you have a decomposition - you can multiply everything by any square number you choose..