2
$\begingroup$

I'm interested in examples like these, where the sum of $n$ squares equals the sum of another $n$ squares.

$3^2 + 11^2 \quad = \quad 7^2 + 9^2 \quad = \quad 130$

$5^2 + 6^2 + 10 ^ 2 \quad = \quad 4^2 + 8^2 + 9^2 \quad = \quad161$

$4^2 + 9^2 + 11^2 \quad = \quad 5^2 + 7^2 + 12^2 \quad = \quad 218$

$3^2 + 6^2 + 10^2 + 11^2 \quad = \quad 4^2 + 5^2 + 9^2 + 12^2 \quad = \quad 266$

Is there a way to generate equalities like these?

If not, is there a way to, given $n$ integers, find a combination of another $n$ integers that satisfies this condition? Or maybe there is a way to tell if a solution exists?

$\endgroup$
  • $\begingroup$ See math.stackexchange.com/questions/2069687/… $\endgroup$ – Robert Z Jun 7 '17 at 7:35
  • $\begingroup$ There are certainly algorithmic ways to find, given the factorization of $n$, all of the sums of two squares that add to $n$ and all of the sums of four squares that add to $n$. Most $n$ that can be written at all as the sum of two squares can be so written in more than one way (the primes can't, and that's about it). All $n$ can be written as the sum of four squares, and the number of ways grows roughly linearly with $n$! $\endgroup$ – Greg Martin Jun 7 '17 at 8:10
  • $\begingroup$ Well, not for n squares but there is a way you can do that for random numbers on different sides. Just pick a perfect square which is again sum of two squares (greatest in its pythagorean triplet). For example: $25^2+5^2=3^2+4^2+15^2+20^2$ another one is $10^2+25^2=24^2+7^2+6^2+8^2$ $\endgroup$ – I am Back Jun 7 '17 at 8:12
  • $\begingroup$ I posted algorithms that allow one to find all 2-square representations (when possible) and all 3-square representations of an integer on this site. Both methods use quadratic equations and triangular numbers to find the representations. $\endgroup$ – user25406 Jun 8 '17 at 15:12
  • $\begingroup$ here are the links for two algorithms mentioned in my previous comment. math.stackexchange.com/questions/1972771/… and math.stackexchange.com/questions/2070691/… $\endgroup$ – user25406 Jun 13 '17 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.