Let be the set of all positive integers not exceeding such that , that is, .

How many of the elements of can be written as the sum of the three integer squares?

A theorem says that can be written as sum of three integer squares iff for non-negative integers .

So can be written as sum of three integer squares iff , or in another word when with variable has no integer solution.

is not an integer when , and is an integer when .

Work out how many CANNOT be written as sum of three integer squares.

When , are not in .

When , are in .

We require or , hence there are elements in that cannot be written as sum of three integer squares.

There are elements in , hence elements can be written as sum of three integer squares.