Solution:
Let n=a2+b2, where a and b are nonnegative integers. Suppose that each of the squares a2 and b2 is less than 4 times the other, so
a<2b and b<2a.
Since a2+b2 is divisible by 5, so is a2+b2−5b2=a2−4b2=(a+2b)(a−2b). Thus 5 divides either a+2b or a−2b. If 5∣a−2b, then 5∣2(a−2b)+5b=2a+b. Thus 5 divides either a+2b or 2a+b, and by switching the labels a and b we may assume that 5∣a+2b.
Then
5∣4(a+2b)−5b=4a+3b
and
5∣3(a+2b)−10b=3a−4b.
Note that
(54a+3b)2+(53a−4b)2=2516a2+24ab+9b2+9a2−24ab+16b2=2525a2+25b2=a2+b2=n.
We claim that
(54a+3b)2≥4(53a−4b)2
which is equivalent to
4a+3b≥2∣3a−4b∣
which in turn is equivalent to the pair of inequalities
4a+3b≥2(3a−4b) and 4a+3b≥−2(3a−4b)
Simplifying the first inequality yields 11b≥2a which is true since 2b≥a. Simplifying the second inequality yields 10a≥5b which is true since 2a≥b.