2016 AMC 10B Problem 14
How many squares whose sides are parallel to the axis and whose vertices have coordinates that are integers lie entirely within the region bounded by the line , the line and the line
Show solution without answering
Key insight
The line y = pi x slopes up, so a square can only cross it at its top-left corner. Check that corner, then count squares by side length.
Solution
Understand the region. It is a triangle: to the right of and below the line , above , and left of . Corners must have whole-number coordinates, so "above " just means , and "left of " just means .
Which corner can cross the line? The line goes up as it goes right, so the region is widest at the right. For a square, the corner closest to the line is the top-left one. If that corner is on or below the line, the whole square is.
Set up the count. Name a square by its bottom-left corner and side . Its top-left corner is . The square fits when:
- (bottom edge not below the -axis),
- (right edge not past ),
- (top-left corner not above the line).
Since is a whole number, the last rule means is at most the whole-number part of :
| top of square at most |
(For the top would have to be at most , which is impossible.)
Count. For a given and , the bottom can be up to (top limit) . That is (top limit) choices.
- Side ( can be ): .
- Side ( can be ): .
- Side ( can be ): .
- Side ( must be ): the top would need to be at most , but the square is tall. None.
Total: .
The answer is .
Why this works
To check that a square fits under a slanted line, you only need to test the one corner that sticks out furthest toward the line. After that, it is careful counting, organized by the size of the square. The strange numbers and are there only so that squares touching the -axis or the line still count.
Concise solution
A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.
The region is the triangle-like area with , and . For lattice squares the first two conditions simply say and .
Describe a square by its lower-left corner and side . Since the line rises to the right, the corner of the square most likely to cross it is the top-left corner . So the square fits exactly when
Because is an integer, the last condition is , and for (and gives nothing).
For each and the number of valid is when positive:
- : give .
- : give .
- : give .
- : would need , impossible.
Total: .
The answer is .
Review in the AoPS books
- Introduction to Geometry, Chapter 17: Analytic Geometry
- Introduction to Counting & Probability, Chapter 1: Counting Is Arithmetic
- Introduction to Counting & Probability, Chapter 2: Basic Counting Techniques (§2.2)
- Introduction to Algebra, Chapter 8: Graphing Lines
Similar problems
Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.