Back to problem set

Disclaimer: these are my personal solutions; they have not been reviewed, so be careful relying on them as there might be errors. Some competitions may have official solutions from the contest publishers which you may wish to refer to instead if you’re looking for verified solutions.

Problem A1

A grasshopper starts at the origin in the coordinate plane and makes a sequence of hops. Each hop has length $5$, and after each hop the grasshopper is at a point whose coordinates are both integers; thus, there are $12$ possible locations for the grasshopper after the first hop. What is the smallest number of hops needed for the grasshopper to reach the point $(2021, 2021)$?

Solution

Open to see the solution; try solving it first!

Since each hop is of length $5$ and only integral positions are allowed, that means the grasshopper can move in any of the following ways:

  • $(0, \pm 5)$ or $(\pm 5, 0)$
  • $(\pm 3, \pm 4)$ or $(\pm 4, \pm 3)$

The first of these is straightforward; the second group is because $(3, 4, 5)$ are the side lengths of a right triangle.

To go from $(0, 0)$ to $(2021, 2021)$ we need to move as efficiently as possible diagonally across both $x$ and $y$ directions, so taking alternating $(3, 4)$ and $(4, 3)$ steps moves the grasshopper closer to the goal by $(7, 7)$ every two steps.

Note: the alternative of using steps $(5, 0)$ and $(0, 5)$ in either order only moves us by $(5, 5)$ every two steps instead, which is not nearly as efficient.

Unfortunately, $2021$ is not divisible by $7$, so the grasshopper will need to make some adjustments as it gets closer to the target.

Since $\lfloor 2021 / 7 \rfloor = 288$, the grasshopper initially will need to make $288 \cdot 2 = \mathbf{576}$ hops (since the grasshopper needs $2$ hops to move $(7, 7)$ diagonally), and the grasshopper will actually end up at $(288 \cdot 7, 288 \cdot 7) = (2016, 2016)$.

This puts the grasshopper $(2021, 2021) - (2016, 2016) = (5, 5)$ away from its goal, which it can reach in $\mathbf{2}$ additional hops: $(5, 0)$ and $(0, 5)$ in either order.

Thus, the total number of hops the grasshopper will need is $576 + 2 = \boxed{578}$ hops.