On the Cartesian plane , a circle is said to be nice if its center is at the origin and it passes through at least one lattice point (i.e. a point with integer coordinates). Define the points and . How many nice circles intersect the open segment ?
Solution
The square of the radius of a nice circle is the sum of the square of two integers. The nice circle of radius intersects (the open segment) if and only if a point on is a distance from the origin. consists of the points where ranges over . The distance from the origin is . As ranges over ranges over , so the nice circle of radius intersects if and only if . The possible values of are those in this range that are the sum of two perfect squares, and each such value corresponds to a unique nice circle. By Fermat's Christmas theorem, an integer is the sum of two squares if an only if in its prime factorization, each prime that is appears with an even exponent (possibly 0. ) In addition, since squares are 0,1 , or , we can quickly eliminate integers that are 3,6 , or . Now I will list all the integers that aren't 3,6 , or in the range and either supply the bad prime factor or write "nice" with the prime factorization. 626: nice 628: nice \left(2^{2} \cdot 157\right) 629: nice 632: 79 633: 3 634: nice 636: 3 637: nice \left(7^{2} \cdot 13\right) 640: nice \left(2^{7} \cdot 5\right) 641: nice 642: 3 644: 7 645: 3 648: nice \left(2^{3} \cdot 3^{4}\right) 649: 11 650: nice \left(2 \cdot 5^{2} \cdot 13\right) 652: 163 653: nice (653). There are 10 nice circles that intersect .