Advent calendar 2018
13 December
There is a row of 1000 lockers numbered from 1 to 1000. Locker 1 is closed and locked and the rest are open.
A queue of people each do the following (until all the lockers are closed):
- Close and lock the lowest numbered locker with an open door.
- Walk along the rest of the queue of lockers and change the state (open them if they're closed and close them if they're open) of all the lockers that are multiples of the locker they locked.
Today's number is the number of lockers that are locked at the end of the process.
Note: closed and locked are different states.