There are n ≥ 2 lamps L1, L2, ..., Ln in a row. Each of them is
either on or off.
Initially L1 is on and all of the others are off.
Each second the state of each
lamp changes as follows:
if the lamp and its neighbors (L1 and Ln have one neighbor,
any other lamp
has two neighbors) are in the same state,
then it is switched off; otherwise,
it is switched on.
Prove or disprove that all of the lamps will eventually be switched off
if and only if n is a power of two.
Note: This is a problem that I modified from one proposed but not used at
the 47th IMO in Slovenia 2006.