Best Answer gavinksong, 30 July 2013 - 02:58 PM

Spoiler for

Go to the full post
You just run down the path in one direction for a time.

If you haven't caught up to him, you turn and run back to your starting point, and then some more to compensate for the distance you may have lost, and then some more to see if you can catch up to him.

If you still haven't caught up to him, you turn and run back to where you left off in the opposite direction, compensate for lost distance, and then run for a little bit longer.

You repeat this until you've caught up to him.

You run down the path in one direction for T seconds.

If you haven't caught up to your friend, you turn and run in the other direction for T seconds to return to the starting point, and then for 2T/(x-1) more seconds to compensate for lost distance, and then for T more seconds to see if you can catch up to him.

If you still haven't caught up to your friend, you turn and run again for 2T+2T/(x-1) seconds back to where you left off, and then for 2(2T+2T(x-1))/(x-1) seconds to compensate for lost distance, and then T more seconds to see if you can catch up to him.

If you haven't caught up to him, you turn and run back to your starting point, and then some more to compensate for the distance you may have lost, and then some more to see if you can catch up to him.

If you still haven't caught up to him, you turn and run back to where you left off in the opposite direction, compensate for lost distance, and then run for a little bit longer.

You repeat this until you've caught up to him.

**Demo**You run down the path in one direction for T seconds.

If you haven't caught up to your friend, you turn and run in the other direction for T seconds to return to the starting point, and then for 2T/(x-1) more seconds to compensate for lost distance, and then for T more seconds to see if you can catch up to him.

If you still haven't caught up to your friend, you turn and run again for 2T+2T/(x-1) seconds back to where you left off, and then for 2(2T+2T(x-1))/(x-1) seconds to compensate for lost distance, and then T more seconds to see if you can catch up to him.

And then repeat, turning and running for T(n) seconds if you have turned for the nth time.

T(n+1) = T(n)*(x+1)/(x-1) + T(0)