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.