There are light bulbs in a row. Initially the middle (the -th) one is lit, and all the others are off. In one step it is allowed to choose two non-adjacent off bulbs between which all the bulbs are lit, and to change the state of these two bulbs as well as of all the bulbs between them (for example, from the configuration ооо one obtains о ). What is the maximum number of steps that can be performed?
(Dušan Đukić)
Problem 1410
Official solution
The answer is .
Let us assign to the -th light bulb the number and define the value of a configuration as the sum of the numbers on the lit bulbs. The value of the initial configuration is , and with each step it increases by a natural multiple of the number . A step increases the value by exactly if the -th bulb changes state; we call such a step good.
Since the value cannot exceed (because it is not possible for all the bulbs to be lit), it is not possible to perform more than steps. This number can be attained: it suffices to show that it is possible to perform at least steps.
We will prove by induction on that, starting from a configuration of value at most , we can, by a sequence of good steps, obtain a configuration of value at least . This is directly checked for . Let . By the induction hypothesis for , it is possible to reach a configuration of value at least with the first and last bulb off. In such a configuration, besides the first and last bulb, the bulbs that may be off are
only the -th,
only the -th and one of its neighbors, or
only one of two neighboring ones.
In each of these three cases, in at most three good steps we achieve that the first and last bulb become lit and that the value of the remainder of the configuration (without these two bulbs) is at most .



Applying the induction hypothesis for once more completes the induction.