Imagine that you have an infinite row of stones and that you have a group of frogs.
Frogs always jump forward an increasing number of stones, starting with 1, and then turn around, continuing the increasing pattern. For example: 1 stone forward, 2 stones forward, 3 stones forward, 4 stones backward, 5 stones backward.
For this problem, we only consider the frogs that return exactly on their starting stone.
The first frog that returns exactly on the starting stone is the one that jumped 1+2 stones forward and then 3 stones backward. Several frogs after that jump past the starting stone.
On which stone did the next frog (i.e., after the one that turned around at stone 3) that returns exactly to the starting stone turn around?
On which stone did the last frog that returns to the starting stone turn around? If infinite, answer 999999999999 (12 nines).