A rectangular grid of squares has rows and columns. Each square has room for two numbers. Horace and Vera each fill in the grid by putting the numbers from through into the squares. Horace fills the grid horizontally: he puts through in order from left to right into row , puts through into row in order from left to right, and continues similarly through row . Vera fills the grid vertically: she puts through in order from top to bottom into column , then through into column in order from top to bottom, and continues similarly through column . How many squares get two copies of the same number?
- A)
- B)
- C)
- D)
- E)
Answer
C
Key insight
Horace writes 91(r−1) + c and Vera writes 141(c−1) + r. Setting them equal gives 9r = 14c − 5, solved by c = 1, 10, 19, …
Solution
1. Horace's number in a square. Use row (from to ) and column (from to ). Horace fills rows of . Before row he has filled full rows, then he counts more:
Check: row , column gives , as the problem says.
2. Vera's number in the same square. She fills columns of . Before column she has filled full columns, then she counts more:
3. Set them equal.
Move the 's to the left and the 's to the right: . Divide by :
4. Find the first few solutions by trying . We need to be a multiple of .
- : . Yes, .
- to : . None is a multiple of .
- : . Yes, .
Why a jump of ? Adding to adds to , and is a multiple of . So the pattern of which work repeats every columns, and since only worked among to , the solutions are exactly
with going up by and going up by each time.
- Stay inside the grid. The column can go up to , and the row up to . Both reach their limit at the same step, so the solutions are the steps : that is squares. The last one is the bottom-right corner, where both write .
The answer is .
Why this works
Each way of filling gives a simple formula in the row and column, so "same number in a square" is one equation with two whole-number unknowns. Trying small values finds the first solution and the jump size, and the rest form an evenly spaced list. When counting an evenly spaced list, count the terms, not the gaps; the two corner squares (both hold and ) are a good check that the list is right.
The trap
Listing c = 1, 10, 19, …, 91 and counting the 10 gaps instead of the 11 values, choice (B).
Concise solution
Index the square in row and column , with and .
Horace works in rows of , so he finishes complete rows and then counts squares:
Vera works in columns of , so she finishes complete columns and then counts squares:
Set :
after dividing by . So
Reduce modulo : , i.e. , and is invertible mod , so . Write
Now impose the size of the grid:
Both give the same range, so : that is squares. They run from , which holds twice, to , which holds twice.
The answer is .
Review in the AoPS books
- Introduction to Number Theory, Chapter 7: Algebra With Integers
- Introduction to Number Theory, Chapter 12: Introduction to Modular Arithmetic
- Intermediate Algebra, Chapter 20: Some Advanced Strategies (§20.2)
- Introduction to Algebra, Chapter 11: Special Factorizations (§11.5)
Techniques
Set up the equation/formula and compute; no special trick needed · Substitute to simplify (u = x+1/x, shifting, scaling)