100 lockers
A hallway has 100 closed lockers, numbered 1 to 100. Student 1 opens every locker. Student 2 toggles every 2nd locker (closing it if open, opening it if closed). Student 3 toggles every 3rd locker, and so on, up to student 100.
Which lockers are open at the end, and how many are there?
Show hint
Locker n is toggled once for every divisor of n. Which numbers have an odd number of divisors?
Show solution
The perfect squares stay open: 1, 4, 9, 16, 25, 36, 49, 64, 81, 100. That is 10 lockers.
Divisors come in pairs (for 12: 1 and 12, 2 and 6, 3 and 4), so most numbers have an even count and end up closed. A perfect square has one divisor paired with itself (6 × 6 = 36), giving an odd count, so it ends up open.
Want a problem like this every day? See today's problem and keep a streak going.