I'm going to be thinking about these all day now.
This is akin to the day that I spent trying to come up with an analytic formula for the number of points on a regular grid within a circle of arbitrary radius centered on a gridpoint.
The best I could come up with was:
[2*floor(r/sqrt(2))+1]^2 + 4*[sum{n=floor(r/sqrt(2))+1 to n=floor(r) of floor(sqrt(r^2-n^2)) * 2 + 1}]
Prooving this formula is left as an exercise to the reader, as is coming up with a better one.

