Problem

Source: IMO 1993, Day 2, Problem 6

Tags: invariant, polynomial, combinatorics, algorithm, System, IMO, IMO 1993



Let $n > 1$ be an integer. In a circular arrangement of $n$ lamps $L_0, \ldots, L_{n-1},$ each of of which can either ON or OFF, we start with the situation where all lamps are ON, and then carry out a sequence of steps, $Step_0, Step_1, \ldots .$ If $L_{j-1}$ ($j$ is taken mod $n$) is ON then $Step_j$ changes the state of $L_j$ (it goes from ON to OFF or from OFF to ON) but does not change the state of any of the other lamps. If $L_{j-1}$ is OFF then $Step_j$ does not change anything at all. Show that: (i) There is a positive integer $M(n)$ such that after $M(n)$ steps all lamps are ON again, (ii) If $n$ has the form $2^k$ then all the lamps are ON after $n^2-1$ steps, (iii) If $n$ has the form $2^k + 1$ then all lamps are ON after $n^2 - n + 1$ steps.