Skip to main content

2007 AIME II Problem 5

Problem 5 of 15EasierGeometryNumber TheoryProblem-Solving Techniques

The graph of the equation 9x+223y=20079x + 223y = 2007 is drawn on graph paper with each square representing one unit in each direction. How many of the 11 by 11 graph paper squares have interiors lying entirely below the graph and entirely in the first quadrant?

Your answer

Integer from 0 to 999
Show solution

Solution

The line meets the axes at (223,0)(223, 0) and (0,9),(0, 9), so all qualifying squares lie inside the 223×9223 \times 9 rectangle, which contains 223⋅9=2007223 \cdot 9 = 2007 unit squares. Because gcd⁡(9,223)=1,\gcd(9, 223) = 1, the segment passes through no interior lattice point; it crosses 222222 interior vertical lines and 88 interior horizontal lines, entering a new square at each crossing, so it passes through the interiors of 223+9−1=231223 + 9 - 1 = 231 squares. The other 2007−231=17762007 - 231 = 1776 squares lie entirely above or entirely below the segment. The segment’s midpoint (2232,92)\left(\frac{223}{2}, \frac{9}{2}\right) is the center of the rectangle, so rotating by 180∘180^\circ about it swaps the two groups. Hence exactly half of them, 888,888, lie below the graph.
AoPS wiki

Tagged: lattice point · greatest common divisor · symmetry

More practice