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

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.

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

Your solution seems correct. However, contains 125,000 elements, not 124,999 (you have to add 1 b/c you have an inclusive set). So the answer should be 93,750.

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

Thank you. You are right. does contain 125000 elements.

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

it appears that i agree with your answer, although i do not know how you can conclude that x is an integer when k = 0. for then:

x = m + 7/8 - 1/2 = m + 3/8, which is *not* an integer.

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

cannot be zero (because every integer in is congruent to 4 mod 8).

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

i am saying that when k = 0, x is not even an integer.

look, when k = 0, 8x - 4 = 8m + 7

8(x - m) = 11 ---> x - m is not an integer ---> x is not an integer.

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

You guys are right. I have got the details wrong about . Thank you guys for pointing it out and explaining.