← RoseCode

ROSECODE 388

Not a sum of distinct squares

Philippe_57721 · Programming ·

It is known since Lagrange that every positive integer can be represented as the sum of integer squares, 4 integers being enough.

But, if we add the constraint that all squares must be distinct, some integers are not representable as such a sum.

This set is finite.

How many positive integers can not be represented by a sum of distinct squares, and what is their sum? (You are given that the largest one if less than 5000)

Answer format: Count,Sum

[My timing: 15 s]