# Distance from origin

A man moves 1km east, 2km north, 3km west, 4km south, 5km east, 6km north, 7km west and so on until he travels total of 300km. So what will be the distance from origin?

-
What if he started at or near one of the poles? –  Harald Hanche-Olsen Oct 17 '12 at 17:37

Hint: how many segments does he make? Every four segments take him 2 km west and 2 km south, so you know were he is after the highest multiple of 4 segments. Then apply whatever is left to get the final location. You will need Pythagoras at the end.

-

Observe that every new segment is 1km longer than the previous one. So the total distance is basically the sum of the first $n$ integers. Do you know a closed formula for that (Hint: Gauss). That allows you to determine how long was the last segment and it's easy to calculate its direction. But first make a drawing: it'll show you a pattern.

-
Obviously the pattern is the one described by Ross. –  Andrea Orta Oct 17 '12 at 17:27