## Locker Problem Solution

A forum for good logic/math puzzles.

Moderators: jestingrabbit, Moderators General, Prelates

### Locker Problem Solution

all the lockers will be open, except for lockers whose numbers are perfect squares. it is easiest to pick a random locker and see what happens to it, like the 12th. the only students who will “switch” locker 12 are students 1,2,3,4,6,12. note the students who switch each locker are the students whose number position is a factor of the lockers they open. In the case of locker 16, it will be switched by students 1,2,4,8,16. Since all numbers that are not perfect squares have an even number of distinct factors, then all the lockers that are not perfect squares must return to their original position (open). Perfect squares’ factors also come in pairs, but there is one factor that is its own pair through multiplicity. Because of this, there will always be an odd number of students switching the lockers that are perfect squares, thus resulting in those lockers to be closed.