Challenge 32: Flipping Switches
Can you work out which lightbulbs are on?
A room contains 100 light bulbs set out in a long line. Each light bulb has a light switch in front of it. The light bulbs are all off.
Flicking a switch turns a light bulb on if it was off, and off if it was on.
Outside the room are 100 mathematicians.
The first mathematician enters the room and flicks every switch (switch 1, switch 2, switch 3, ...)
The second mathematician enters the room and flicks every second switch (switch 2, switch 4, switch 6, ...)
The third mathematician enters the room and flicks every third switch (switch 3, switch 6, switch 9, ...)
And so on. This goes on until all mathematicians have been in the room.
Which light bulbs are on now? Why these, and not the others?