0

Some backstory, forgive me for not having any kind of mathematical background:

A friend of mine received an optional programming assignment to write an algorithm to find the four squares that sum to a given 5-digit number. The professor asserted that for every number there will be a solution. However, he added the constraint that all numbers must be unique amongst themselves.

I started playing with it, and for both the recursive and loop-based function I wrote, I got the following list of counterexamples when uniqueness was enforced:

12288
16384
18432
24576
28672
32768
45056
49152
65536
73728
98304

Is this an error in my programming, or does the conjecture indeed not hold when this constraint is included?

J.A.K.
  • 101
  • 1
    Powers of 2 never have all four component squares unique, so the onclusion of 16384, 33768 and 65536 is correct. – Oscar Lanzi Feb 27 '20 at 14:18
  • 2
    All of these numbers are multiples of $2048 = 2^{11}$, which is interesting. – Michael Lugo Feb 27 '20 at 14:35
  • 1
    Dividing by that factor gives 6, 8, 9, 12, 14, 16, 22, 24, 32, 36, 48. Out of these, 14 can itself be expressed with unique squares ($3^2+2^2+1^2+0^2$), but multiplying by an odd-exponent power of two causes pairing up for that case and uniqueness is lost. – Oscar Lanzi Feb 27 '20 at 14:49
  • Many thanks to both of you for the observations. You'll probably have saved a few students a headache – J.A.K. Feb 27 '20 at 19:51
  • "unique" is an unlucky formulation. You probably mean "distinct perfect squares". "unique" would mean that there is essentially only one way to represent the number as the sum of $4$ squares. – Peter Mar 05 '20 at 09:50

0 Answers0