We need to solve the following system of two diophantine equations::
$$\quad x^2+y^2+z^2\ =\ u^2+v^2+w^2.$$
$$x+y+v\ =\ u+w+z$$
I will present some (not all) solutions. Naturally, there is more than one way to select only a special set, and I intend to present more than one (still far from all).
@Alexey has provided a complete Answer. This perhaps still has left some room for entertaining solutions. (Especially, that they may carry a combinatorial/geometric bonus).
FIRST METHOD Let's search for the pairs of triples $\ (x\ y\ z)\ \ (u\ v\ w),\ $ which are related to the Pythagorean triples as follows:
- $\quad x^2 + y^2 = v^2 $
- $\quad z^2 = u^2 + w^2 $
This would imply the first equality: $\ x^2+y^2+z^2\ =\ u^2+v^2+w^2.\ $ Then we only need to assure equality of perimeters of our rectangular triangles:
$$\ x+y+v\ =\ u+w+z$$
Now let's use the popular parametrization (it satisfies 1. and 2.):
- $\quad x:=b^2-a^2\qquad y:=2\!\cdot a\!\cdot b\qquad v:=a^2+b^2\qquad (0<a<b)$
- $\quad u:=s^2-r^2\qquad w:=2\!\cdot r\!\cdot s\qquad z:=r^2+s^2\qquad (0<r<s)$
The equality to be assurred (see the above centered formula) now spells:
$$ b\cdot(a+b)\ = s\cdot(r+s)$$
Thus for every two factorizations of an integer into positive factors:
$$ b\cdot c = s\cdot t\qquad(b<c<2\!\cdot\! b\quad and\quad s<t<2\!\cdot\! s) $$
and letting $\ a:=c\!-\!b\ \ \ r:=t\!-\!s,\ $ we obtain the respective two requested triples.
EXAMPLE (FIRST METHOD) Consider the following two factorizations of the same positive integer:
$$ 15\cdot 28\ =\ 20\cdot 21 $$
(We see that the larger factors on each side are smaller than their doubled partner: $\ 15<28<2\cdot 15\ $ and $\ 20<21<2\cdot 2\cdot 20$). Now:
$$a:=13\ \ b:=15\qquad r:=1\ \ s:=20$$
$$x:=56\ \ y:=390\ \ v:=394\qquad u:=399\ \ w:=40\ \ z:=401$$
This is a solution; visually:
- $\ 56^2+390^2+401^2\ =\ 399^2+394^2+40^2$
- $\ 56+390+394\ =\ 399+40+401$
SECOND METHOD (under construction)
OPTIONAL STUFF Now--for the sake of completeness--I will present certain solutions of a system of equations similar to (but different from) the one from the Question; this is a more symmetric system:
$$\quad x^2+y^2+z^2\ =\ u^2+v^2+w^2.$$
$$x+y+z\ =\ u+v+w$$
The idea is simple. Let's search for the pairs of triples $\ (x\ y\ z)\ \ (u\ v\ w),\ $ which are related to the Pythagorean triples as follows:
- $\quad x^2 + y^2 = u^2 $
- $\quad z^2 = v^2 + w^2 $
This would imply the first equality: $\ x^2+y^2+z^2\ =\ u^2+v^2+w^2.\ $ Then we only need to assure equality
$$\ x+y-u\ =\ v+w-z$$
Now let's use the popular parametrization (it satisfies 1. and 2.):
- $\quad x:=b^2-a^2\qquad y:=2\!\cdot a\!\cdot b\qquad u:=a^2+b^2\qquad (0<a<b)$
- $\quad v:=s^2-r^2\qquad w:=2\!\cdot r\!\cdot s\qquad z:=r^2+s^2\qquad (0<r<s)$
The equality to be assurred (see the above centered formula) now spells:
$$ a\cdot(b-a)\ = r\cdot (s-r)$$
Thus for every two factorizations of an integer into positive factors:
$$ a\cdot c = r\cdot t$$
and letting $\ b:=a\!+\!c\ \ s:=r\!+\!t,\ $ we obtain the respective two requested triples.
EXAMPLE The simplest of the kind (let's not worry here too much about the triples being relatively prime):
$$1\cdot 4\ =\ 2\cdot 2$$
$$a:=1\ \ b:=b':=5\ \ (and\ \ a':=4)\qquad r:=2\ \ s:=4$$
$$x=24\ \ \ y=10\ \ \ u=26\qquad(or\ \ x'\!=9\ \ \ y'\!=40\ \ \ u'\!=41)$$
$$z=20\ \ \ v=12\ \ w=16$$
Thus we get:
- $24^2+10^2+20^2\ =\ 26^2+12^2+16^2$
- $24+10+20\ =\ 26+12+16$
as well as
- $9^2+40^2+20^2\ =\ 41^2+12^2+16^2$
- $9+40+20\ =\ 41+12+16$
BONUS By considering--as above--multiple factorizations of any fixed (but easily factorable) integer, we obtain collections of equalities which have patterns of equalities of members of different triples (potentially of some combinatorial/geometric value).