Welcome back to the lab! A school has 1000 lockers and 1000 students with a curious habit. Figure out which lockers are left open at the end, and uncover the pattern that decides it.
Your mission
A school has 1000 lockers, all closed. Then 1000 students walk down the hall, each with the same strange habit. Work out which lockers are left OPEN at the end — and discover the surprising pattern hiding underneath.
Student 1 walks by and opens every locker. Student 2 goes to every 2nd locker and changes it (opens it if closed, closes it if open). Student 3 changes every 3rd locker. In the same way, student number k changes every k-th locker.
The rule
Every locker starts closed. Each time a student changes it, it flips. A student changes a locker only when their number divides the locker number — so the students who touch a locker are exactly the numbers that divide it.
Follow lockers 1 to 12. Write which students change each one, count them, and decide if it ends open or closed. The first four are done for you.
| Locker | Students who change it | How many? | End? |
|---|---|---|---|
| 1 | 1 | 1 | ✓ open |
| 2 | 1, 2 | 2 | ✗ closed |
| 3 | 1, 3 | 2 | ✗ closed |
| 4 | 1, 2, 4 | 3 | ✓ open |
| 5 | |||
| 6 | |||
| 7 | |||
| 8 | |||
| 9 | |||
| 10 | |||
| 11 | |||
| 12 |
A locker ends open only if it was changed an odd number of times. So which lockers get changed an odd number of times? Look at how the numbers that divide a locker pair up.
Work it out
Locker 12. Its divisors pair up: 1 with 12, 2 with 6, 3 with 4. That is 3 neat pairs, so 6 students touch it — an even number. Locker 12 ends closed.
Locker 9. Its divisors are 1, 3, 9. Here 1 pairs with 9, but 3 has no partner — because 3 × 3 = 9! One factor is left alone, so 3 students touch it — an odd number. Locker 9 ends open.
A lonely, unpaired factor only appears when a number is made by multiplying something by itself.
List the open lockers you have found so far, then look for the pattern.
Open lockers (odd number of factors)
Each one equals…
These special numbers have a name:
🔑 Math Word Unlocked
A perfect square is a number you make by multiplying a whole number by itself, like 3 × 3 = 9. Perfect squares are the only numbers with an odd number of factors, because their square root pairs with itself instead of another number. So the open lockers are exactly the perfect squares.
Two things worth checking
What about locker 1? Only student 1 ever touches it, so it is changed one time and stays open. And 1 = 1 × 1 is a perfect square, so it fits the pattern perfectly.
Why can a non-square never stay open? Every factor of a non-square number has a different partner, so the factors always come in complete pairs. An even number of changes always brings the locker back to closed.
1 · The big count
Out of all 1000 lockers, how many are open at the end? (Hint: how many perfect squares are there from 1 to 1000?)
2 · Predict
Without checking every student, decide whether locker 100 is open or closed. What about locker 50?
3 · The last one
What is the highest-numbered locker that is still open?
4 · One more
Is locker 225 open or closed? How do you know?