random math-y thought: clearly, the first circle that hits any integer points at all is the one with radius 1, which hits the points (1,0), (-1,0), (0,1), and (0,-1). Four points total. A little later on, with radius sqrt(5), you hit eight points: (1,2), (2,1), (-1,2), (2,-1), (1,-2), (-2,1), (-1,-2), and (-2,-1)
What is the sequence of radii rn such that the circle at the origin with radius rn hits more integer points than any origin-centered circle with radius r < rn?
@Felthry hmm
if r is an integer, then the four points (r,0), (0,r), (-r,0), (0,-r) will be included
and if r is an integer multiple s of the square root of two, then the four points (s,s), (s,-s), (-s,-s), (-s,s) will be included - call these (±s,±s)
otherwise, if there are integers a and b such that a>b>0 and a²+b²=r², then the eight points (±a,±b) and (±b,±a) will be included
I think Pythagorean triples are going to be important here
@packbat Yeah, exactly. But not only pythagorean triples, since r is not restricted to being an integer--though it must be the square root of an integer, because otherwise the circle won't hit any integer points
@Felthry Oh, it's exactly as interesting as it initially seems! 😄
...wait, is it this function? http://mathworld.wolfram.com/SumofSquaresFunction.html
I was going hunting for lists of numbers that are sums of more squares, and it seems like SquaresR[2, r²] is going to be the function that returns how many intersections there are for the circle of radius r
...doesn't tell us the sequence but connects this to a bunch of other number theory I guess?