sum of squares less than N shown:
This is a picture of the integer points (x,y,z) with
for an integer N; these are integer lattice points on the
sphere of radius √N.
These are projected to the (x,y) plane,
i.e., forget z. Then they are marked by the cyan squares.
For every point (x,y,z), there is some N with
But for some N this equation has lots of solutions, and for some it has
none at all.
Legendre's Three squares theorem tells you when it's possible.
The little black dots correspond to points where z=0, so N is the sum of two squares, which is possible depdning on the prime factors mod 4.
You can choose to either scale the grid to fit the screen, or keep the same scale througout. You can change N by the slider, or have it automatically
change for a pretty animation.
I put in an option to see the colours of (x,y) depdending on the largest
i < N with some z with (x,y,z).(x,y,z)=i. OR, depending on smallest such i.
This reminded me of this