2015 AMC 10B Problem 24
Aaron the ant walks on the coordinate plane according to the following rules. He starts at the origin facing to the east and walks one unit, arriving at . For , right after arriving at the point , if Aaron can turn left and walk one unit to an unvisited point , he does that. Otherwise, he walks one unit straight ahead to reach . Thus the sequence of points continues , and so on in a counterclockwise spiral pattern. What is ?
Show solution without answering
Key insight
At square step numbers the ant sits at a spiral corner. Step 1936 is at (-22, 22); then 44 steps down and 35 steps right.
Solution
Step is far too many to trace, so trace the first few turns, find a pattern, and jump ahead.
Step 1: trace the start. The spiral goes: step east, north, west, south, east, north, west, south, and so on. The side lengths are
Step 2: look at square numbers. Add up the side lengths: , , , , , , . The square numbers show up at every other corner. Here are those corners:
| step | |||||
|---|---|---|---|---|---|
| point |
Step 3: the pattern for even squares. At step the ant is at , and at step it is at . In general, at step it is at , the top-left corner, having just walked west. From there it turns left and walks south for steps, then turns left again and walks east for steps.
(Check with : from , steps south reach at step , then steps east reach at step . That matches the table.)
Step 4: jump to 2015. The largest even square not above is (and is too big). So with :
- At step the ant is at .
- It walks steps south, reaching at step .
- Then it walks east. Step is steps later, at .
The answer is .
Why this works
In a square spiral the side lengths go , and adding them gives square numbers at every other corner. So square step numbers are easy landmarks. Work out a few small cases, find where the landmarks are and which way the ant is facing there, then jump to the landmark just below the step you want and walk the rest.
Alternative approach
Use odd squares instead. From the table, step is at , reached while walking east: step is at and step is at . So step is at . Step is steps earlier on that same eastward stretch, so it is at . Getting the same point from both landmarks is a good check.
Concise solution
A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.
Trace the spiral and record where the ant is at perfect-square indices:
The pattern: from the ant walks a leg of length (turning left first), then a leg of length , using steps and arriving at . Each pair of legs moves the ant to the opposite diagonal corner one ring further out. In particular, for even indices
reached while walking west, so the next leg goes south (length ) and the one after goes east (length ).
Since , start from . The ant walks steps south to , then heads east. The remaining steps go east:
The answer is .
Review in the AoPS books
- Introduction to Algebra, Chapter 21: Sequences & Series (§21.1, §21.2, §21.3, §21.4)
- Introduction to Geometry, Chapter 17: Analytic Geometry
- Introduction to Counting & Probability, Chapter 5: More With Combinations (§5.2)
- Prealgebra, Chapter 15: Problem-Solving Strategies (§15.1)
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.