Problem:
During a recent campaign for office, a candidate made a tour of a country which we assume lies in a plane. On the first day of the tour he went east, on the second day he went north, on the third day west, on the fourth day south, on the fifth day east, etc. If the candidate went 2n2​ miles on the nth day of his tour, how many miles was he from his starting point at the end of the 40th day?
Solution:
Consider a Cartesian coordinate system with origin at the candidate's starting point, positive x-axis pointing east, and positive y-axis pointing north. At the end of the 40th day the candidate is at the point