Problem:
A grid of points consists of all points in space of the form , where , and are integers between and , inclusive. Find the number of different lines that contain exactly of these points.
Solution:
Let the grid of points be referred to as the cube. Any line parallel to an edge of the cube and containing two of the grid points must contain of the grid points. Thus no line parallel to an edge of the cube contains exactly of the grid points.
There are planes, each parallel to a face of the cube and each containing of the grid points in a square. The points of this grid determine lines that each contain exactly grid points. These lines are two units above and two units below each of the diagonals of each such square.
Now consider a line that is not parallel to an edge or a face of the cube and contains exactly grid points. A vector parallel to such a line has the form , where , , and are nonzero integers that have no common factor greater than . The line has equation
where , and are integers, and there are consecutive integer values of such that , and are all integers between and , inclusive. It follows that each of , and must be ; without loss of generality, assume . Then there are four possible vectors that can be parallel to a line containing exactly grid points: . Each of these four vectors is parallel to one of the space diagonals of the cube. By symmetry, it suffices to find the number of lines parallel to the vector , and then multiply this result by .
The lines parallel to must intersect the grid in a point on one of the planes , or . Then any one of the -point lines has the form
and the grid points are realized for . Each of the coordinates , , and is between and , inclusive, for these values of , and at least one of these numbers is when . Thus at least one of , and is , at least one is equal to , and the third is or . If two of , and are equal to , then is one of the triples , or . If two of , and are equal to , then is one of the triples , or . If , and are distinct, then there are possibilities for . This accounts for possibilities for .
Thus the number of lines containing exactly 8 of the lattice points is .
The problems on this page are the property of the MAA's American Mathematics Competitions