MathLabs

Problem 5

Larry and Rob are two robots travelling in one car from Argovia to Zillis. Both robots have control over the steering and steer according to this algorithm: Larry makes a 90° left turn after every ℓ\ell kilometer driving from the start; Rob makes a 90° right turn after every rr kilometer driving from the start, where ℓ\ell and rr are relatively prime positive integers. If both turns occur simultaneously, the car keeps going without changing direction. Assume the ground is flat and the car can move in any direction. The car starts from Argovia facing towards Zillis. For which pairs (ℓ,r)(\ell,r) is the car guaranteed to reach Zillis, regardless of how far it is from Argovia?
Step 3 of 6: Encode one section complexly
mk=i⌊k/ℓ⌋(−i)⌊k/r⌋,0≤k<ℓrm_k=i^{\lfloor k/\ell\rfloor}(-i)^{\lfloor k/r\rfloor},\quad 0\le k<\ell r
Detailed analysis

Now suppose ℓ≡r(mod4)\ell\equiv r\pmod4. Represent east, north, west, south by 1,i,−1,−i1,i,-1,-i. Let mkm_k be the direction of the (k+1)(k+1)-st kilometer in a section. For ℓ≡r≡1(mod4)\ell\equiv r\equiv1\pmod4, with aka_k the remainder of kk modulo ℓ\ell and bkb_k the remainder modulo rr, mk=(−i)akibkm_k=(-i)^{a_k}i^{b_k}; for ℓ≡r≡3(mod4)\ell\equiv r\equiv3\pmod4 the analogous expression is mk=iak(−i)bkm_k=i^{a_k}(-i)^{b_k}.