Problem

Source: 2021 Simon Marais, B2

Tags: combinatorics



Let $n$ be a positive integer. There are $n$ lamps, each with a switch that changes the lamp from on to off, or from off to on, each time it is pressed. The lamps are initially all off. You are going to press the switches in a series of rounds. In the first round, you are going to press exactly $1$ switch; in the second round, you are going to press exactly $2$ switches; and so on, so that in the $k$th round you are going to press exactly $k$ switches. In each round you will press each switch at most once. Your goal is to finish a round with all of the lamps switched on. Determine for which $n$ you can achieve this goal.