The Locker Puzzle

This is my favorite puzzle.

A hallway in a school has 100 lockers. A student runs down the hall and opens every locker. A second student runs down the hall and closes every other locker, starting at the second. A third student runs down the hall and “flips” every third locker, starting at the third – if the locker is open, he closes it; if it’s closed, he opens it.

A total of 100 students run down the hall, opening and closing lockers. In general, the n-th student flips every n-th locker.

After all 100 students run through the hall, which lockers are open?

Leave a Reply

Time limit is exhausted. Please reload the CAPTCHA.

Archives