Overview
The 100 lockers puzzle links a physical toggling process to the number theory of divisors — and the answer, the perfect squares, feels almost magical.
How to solve The 100 Lockers
- Locker n is toggled once by student k for every k that divides n.
- So the number of toggles equals the number of divisors of n.
- A locker ends open only if it was toggled an odd number of times — i.e. n has an odd number of divisors.
The key insight
Divisors normally pair up (d with n/d), giving an even count — except when d equals n/d, i.e. n is a perfect square. Only squares have an unpaired middle divisor, so only they stay open.
Variations & echoes
- The same divisor-pairing argument explains why perfect squares are 'special' in many problems.
- Change the toggling rule and you probe other number-theoretic properties.
Frequently asked questions
How many lockers are open?
Ten: 1, 4, 9, 16, 25, 36, 49, 64, 81 and 100 — the perfect squares up to 100.