Should be 2*1002*1003 - 1. start from the middle. Go to the first one, back to the last one, go to 2nd, back to 2nd from last, and so on. End at ont one after the start point. General formula: N= 2k+1, 2*k*(k+1) - 1; N = 2k, 2*k^2 - 1. Proof: Between the first and second, you can walk at most twice, so is between last and secon from last. Between second and third, you can walk at most 4 times, etc. So the total walks is at most 2*k*(k+1) or 2*k^2. Because the the end needs to be different from the beginning, so we need to minus 1. www.ddhw.com
|