Problem

Source: Indian Postal Coaching 2009 set 5 p6

Tags: combinatorics



Let $n > 2$ and $n$ lamps numbered $1, 2, ..., n$ be connected in cyclic order: $1$ to $2, 2$ to $3, ..., n-1$ to $n, n$ to $1$. At the beginning all lamps are off. If the switch of a lamp is operated, the lamp and its $2$ neighbors change status: off to on, on to off. Prove that if $3$ does not divide $n$, then (all the) $2^n$ configurations can be reached and if $3$ divides $n$, then $2^{n-2}$ configurations can be reached.