6
$\begingroup$

I wrote a computer program as an exercise in dynamic programming. It finds the minimum number of distinct squares which sum to some positive target integer n. I found something interesting and would like to know if there's any relevant work on it. My question is basically the following.

Are 124 and 188 the only two positive integers that require a minimum of 6 distinct terms to express as a sum of squares?

1^2 + 2^2 + 3^2 + 5^2 + 6^2 + 7^2 = 124
1^2 + 2^2 + 3^2 + 5^2 + 7^2 + 10^2 = 188

There doesn't appear to be any shortage of numbers that require a minimum of 5 distinct squares. It seems conceivable to me that there are no more because for large n there are so many possible combinations, but I can't prove it. My approach was to try to disprove it with a counterexample.

The time and space complexity of my program is currently O(n^1.5) so it gets quite greedy for RAM very quickly. I think I could rewrite it to search for a counterexample greater than my current limit of 5,000,000, but if it is something that is already known, then please let me know. Thanks.

EDIT: I found this http://matwbn.icm.edu.pl/ksiazki/aa/aa67/aa6745.pdf in which '2. An initial upper bound' claims to prove that every integer n greater than or equal to 4^5 = 1024 can be expressed as the sum of 5 distinct squares. I guess that does it if the proof is correct and my program works correctly.

$\endgroup$
4
  • 3
    $\begingroup$ Numbers Expressible as Sum of Five Distinct Squares $\endgroup$
    – Sil
    Commented Feb 25 at 16:05
  • 1
    $\begingroup$ Unless I misunderstand, Table 1 on page 378 also seems to say that every integer greater than 245 can be expressed as a sum of 5 or fewer distinct squares. $\endgroup$
    – MJD
    Commented Feb 25 at 16:45
  • $\begingroup$ @MJD I hadn't got that far in the document yet. In any case, I'm satisfied that there are no more cases. Thanks for your interest. $\endgroup$ Commented Feb 25 at 16:46
  • 1
    $\begingroup$ Thanks for your interesting post! $\endgroup$
    – MJD
    Commented Feb 25 at 16:47

0

You must log in to answer this question.

Browse other questions tagged .