Problem

Source: Macedonian TST 2022, P1

Tags: combinatorics, TST



Let $n$ be a fixed positive integer. There are $n \geq 1$ lamps in a row, some of them are on and some are off. In a single move, we choose a positive integer $i$ ($1 \leq i \leq n$) and switch the state of the first $i$ lamps from the left. Determine the smallest number $k$ with the property that we can make all of the lamps be switched on using at most $k$ moves, no matter what the initial configuration was. Proposed by Viktor Simjanoski and Nikola Velov