Rachinsky quintets  
This 1895 painting of Nikolai Bogdanov-Belsky shows mental calculations in the public school of Sergei Rachinsky. Boys in a Russian village school try to calculate $(10^2+11^2+12^2+13^2+14^2)/365$ in their heads. One of the methods of solution is based on the equality $10^2+11^2+12^2=13^2+14^2$. Now this Rachinsky equality can be considered as a generalization of the well-known Pythagorean triple (3,4,5), $3^2+4^2=5^2$, and in analogy with the Pythagorean triples one can define Rachinsky quintets as a set of five positive integers $(a,b,c,d,e)$ such that $a^2+b^2+c^2=d^2+e^2$. It is known that all primitive Pythagorean triples $(a,b,c)$ such that $a^2+b^2=c^2$ are generated by Euclid's formula $a=m^2-n^2$, $b=2mn$, $c=m^2+n^2$, where $m$ and $n$ are positive integers such that $m>n$, $m$ and $n$ are coprime, and $m \not\equiv n \bmod 2$. Can one establish an analogous result for Rachinsky quintets?


The following recipe (algorithm) generates all solutions. It may be viewed as a parametrization in a general(ized) sense.

W.l.o.g. we may assume that $c$ is odd. Then
$$ \left(\frac{x-y}2\right)^2 + \left(\frac{u-v}2\right)^2 + c^2
        \ =\ \left(\frac{x+y}2\right)^2 + \left(\frac{u+v}2\right)^2 $$
where three conditions hold:


*

*$\ x\equiv y\equiv 1\ \mbox{mod}\ 2$

*$\ u\equiv v\equiv 0\ \mbox{mod}\ 2$

*$\ u\cdot v = c^2-x\cdot y$


i.e. we may take arbitrary $x$ and $y$ as in condition 1, and then one decomposes $c^2-x\cdot y$ (see condition 3), where $\ u\ v\ $ are as in condition 2; of course $\ 4\,|\,c^2-x\cdot y\ $ (and the expressions
under the squares are integers).
