Define the frogs motion as x(n) = a + b*n, where a is the starting position, b is the hop size and n is the number of hops taken.

So any given frog motion is characterized by the pair (a,b). Furthermore, we can sort these pairs by the following criteria:

First by the sum (|a| + |b|).

Then, within the pairs with the same (|a|+|b|), by a.

Finally, within those with the same (|a|+|b|) and the same a, by b.

So the first several frog motions are:

(0,0)

(-1,0) (0,-1) (0,1) (1,0)

(-2,0) (-1,-1) (-1,1) (0,-2) (0,2) (1,-1) (1,1) (2,0)

(-3,0) (-2,-1) (-2,1) (-1,-2) (-1,2) (0,-3) (0,3) (1,-2) (1,2) (2,-1) (2,1) (3,0)

etc.

The strategy is then simple. In the first second, when n=0, the stork tries out the first frog motion (0,0). At n=0, this motion is at x=0, so the stork tries that spot. If it doesnâ€™t get the frog, then in the second second it tries the next pair (-1,0), which at n=1 is at x=-1. Then (0,-1),n=2 is x=-2. Then (0,1),n=3 is x=3. Then (1,0),n=4 is x=1. Then (-2,0),n=4 is x=-2. And so on.

Since all possible frog motions are enumerated in this list, eventually the stork will try the one that actually corresponds to the frogs motion.

Note that the proof that rational numbers are enumerable follows the same strategy where a,b are the numerator and denominator instead. And in that case, you can skip the b=0 possibility. I wasnâ€™t sure whether the statement of the problem implied that b=0 was allowed or not for this problem, but if not then you just remove those pairs from the above list and the proof still holds.

]]>