Question 27
A treasure map consists of a map of an island (extending infinitely in every direction) overlaid with a square grid. The cells are numbered in a spiral as shown.
The pirates divided their treasure among chests buried in some of the cells, namely those “numbered by an $n$ that contains within itself the directions for reaching that cell from cell 1”. By this they mean the following: write $n$ in base ten, and let $a_1,\ldots,a_k$ be its digits, read from left to right. Cell $n$ contains a chest holding part of the treasure

if and only if it can be reached by starting from cell 1, taking $a_1$ steps in one direction (North, South, West or East), then $a_2$ steps in one direction (possibly the same as before), ..., and finally $a_k$ steps in one of the four directions.
For example, cell 12 contains a chest, because starting from cell 1 and taking 1 step North and 2 steps East leads exactly to cell 12. Cell 1, however, contains no chest: taking one step in any direction from cell 1 leads to a different cell. Prove that only finitely many cells contain a buried chest.
The pirates divided their treasure among chests buried in some of the cells, namely those “numbered by an $n$ that contains within itself the directions for reaching that cell from cell 1”. By this they mean the following: write $n$ in base ten, and let $a_1,\ldots,a_k$ be its digits, read from left to right. Cell $n$ contains a chest holding part of the treasure

if and only if it can be reached by starting from cell 1, taking $a_1$ steps in one direction (North, South, West or East), then $a_2$ steps in one direction (possibly the same as before), ..., and finally $a_k$ steps in one of the four directions.
For example, cell 12 contains a chest, because starting from cell 1 and taking 1 step North and 2 steps East leads exactly to cell 12. Cell 1, however, contains no chest: taking one step in any direction from cell 1 leads to a different cell. Prove that only finitely many cells contain a buried chest.