# Find 7-tuples of pairwise distinct positive integers such that the sum of squares of first 4 equals sum of squares of last 3

As already stated in title, find 7-tuples ($a_1,a_2,a_3,a_4,b_1,b_2,b_3$) of pairwise distinct positive integers such that

$$a_1^2+a_2^2+a_3^2+a_4^2=b_1^2+b_2^2+b_3^2$$

This came in RMO 2016 Delhi paper where one was asked to prove that infinite such tuples exist. I have no idea how to do so.

• I would try writing $a_4^2$ as the sum of three differences of two squares. I don't know whether this works, but it looks to have a chance. Also when you have found one solution any scalar multiple of that solution seems to work - did the question require that the tuples had no common factor? – Mark Bennet Oct 12 '16 at 13:56
• This task is very simple in this way. A more interesting case is when we ask the form of solutions. artofproblemsolving.com/community/c3046h1046714__ If this formula is not satisfied then I will write another. – individ Oct 12 '16 at 14:19
• @ghosts_in_the_code Do you mind sending me a copy of the question paper? I would be most grateful if you could. – The Cryptic Cat Oct 12 '16 at 15:10
• Go to rmonorthzone.com It's one of the first links at the top of the page. – ghosts_in_the_code Oct 12 '16 at 15:56
• Appreciate it! :) – The Cryptic Cat Oct 12 '16 at 16:36

One approach is to find a solution by trial. We can start by finding two pairs of squares that sum to the same number, then adding in a Pythagorean triple. So $39^2+52^2=65^2=25^2+60^2$ and a solution is $3^2+4^2+39^2+52^2=5^2+25^2+60^2$. Now replace the $3^2+4^4=5^2$ with other triangles. As there are an infinite number of primitive Pythagorean triangles, this will give an infinite set of solutions that have no common factor.

• What does primitive mean? – ghosts_in_the_code Oct 12 '16 at 14:25
• Primitive Pythagorean triplets have no common factor. Your question did not specify that the numbers in the tuple should share no common factor, but often questions like this do. That is to avoid allowing you to find one solution and then just multiplying all the numbers in it by the same constant to make the infinite collection of solutions. I find it more elegant to show we can find an infinite collection without a common factor. – Ross Millikan Oct 12 '16 at 14:29
• Ok thanks, I think there was some condition like that. I could have thought of this myself, feel bad I didn't. Anyways, is there a simple way to prove there are infinite Pythagorean triplets (all arguments were required to be supported with proof). – ghosts_in_the_code Oct 12 '16 at 14:31
• Yes, there is the standard way to find primitive triples: choose $m,n$ coprime and of opposite parity. $a=m^2-n^2, b=2mn, c=m^2+n^2$ forms a primitive triple, which you can show just by plugging in the algebra to show it is a triple and noting any common factor must divide $a+c$ and $c-a$, which are coprime by construction. – Ross Millikan Oct 12 '16 at 14:36
• Yes to parity. If both are odd or both are even, all of $a,b,c$ will be even. It will still be Pythagorean but not primitive. The points don't matter, I am swimming in them. Happy to help. – Ross Millikan Oct 12 '16 at 14:53

Rewrite as \begin{align}a_4^2&=b_1^2-a_1^2+b_2^2-a_2^2+b_3^2-a_3^2\\ &=(b_1-a_1)(b_1+a_1)+(b_1-a_2)(b_1+a_2)+(b_3-a_3)(b_3+a_3)\end{align} Thus we are essentially asked to write a square as sum of three composite numbers (with mild additional conditions), for example $$100=3\cdot 11+5\cdot 7+2\cdot 16$$ gives us $$4^2+1^2+\color{red}{7^2}+10^2=\color{red}{7^2}+6^2+9^2$$ as an almost solution. The main problem with finding a solution is that if you start with a too small square on the left, you may run into a prime after subtracting two suitable composites (primes are very common among small numbers) are some of the numbers coincide (as above); this is easily avoided by starting with a larger left hand side. For example, we can try $$121=3\cdot 11+4\cdot 6+2\cdot 32,$$ which gives us $$4^2+1^2+15^2+11^2=7^2+5^2+17^2$$ and from this we get one set of infinitely many solutions $$(4n,n,15n,11n,7n,5n,17n),\quad n\in\Bbb N$$

For Diophantine equation.

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

You can record a parameterization.

$$a=2(p+s+r-t-q)k$$

$$b=k^2+t^2+q^2-p^2-s^2-r^2$$

$$c=p^2+s^2+r^2+t^2-k^2-q^2-2(p+s+r-q)t$$

$$d=p^2+s^2+r^2+q^2-k^2-t^2-2(p+s+r-t)q$$

$$x=p^2+k^2+t^2+q^2-s^2-r^2+2(s+r-t-q)p$$

$$y=s^2+k^2+t^2+q^2-p^2-r^2+2(p+r-t-q)s$$

$$z=r^2+k^2+t^2+q^2-p^2-s^2+2(p+s-t-q)r$$