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
Interesting... I would need to plot out one more pattern to see the sequence
@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 *nods*
...oh - it's going to relate to numbers which are the sum of two squares multiple ways, isn't it?
so, like, *does some quick checking* 65 = 1²+8² = 4²+7², so radius √65 is going to have sixteen points because it hits both the (1,8) and (4,7) points plus their eight symmetries.
there's weirdness because if the points fall on the diagonal (e.g. 50=1²+7²=5²+5²), then the intersection that falls on the diagonal will only have four symmetries, and additional weirdness because if the initial number is a square then you get an integer radius and an extra four points on the axes...
@packbat Exactly! You see why this is a more interesting problem than it initially seems.
@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?
hm, I suppose technically this should include the radius-zero circle as the first of the sequence