An Open and Shut Puzzle
If you’ve never heard of the Locker Problem, it’s a puzzler that is sure to challenge your intellect. Like so many mathematical challenges that I enjoy, it’s simply stated, with a unique solution and a clear explanation. After you discover the answer, the more worthwhile activity is to figure out why. As I often said in my classroom, “The answer is often the least important part of the problem; knowing why we get that answer better prepares us for future solutions!”
Here it is: Consider a school with 1000 lockers, the doors to which are all closed at the start of the new academic year. Coincidentally, there are exactly 1000 students who are enrolled there! When the new school year begins, the first student walks by each locker and opens it. The second student then closes the even-numbered lockers. The third student goes to every third locker, shuts it if it is open and opens it if it is closed. The fourth student goes to every fourth locker, shuts it if it is open and opens it if it is closed. In this way, each nth student follows the pattern, thereby changing the status of each nth locker. After all 1000 students pass by all 1000 lockers, which ones remain open?
If you use a small sample, you might come up with the answer on your own. However, the important thing to consider is: why? Why should THOSE numbered lockers be the ones to be open at the end? To see the solution and explanation, scroll down a bit after the following illustration. Hope this was an intriguing pastime and that you look forward to more puzzlers!ANSWER: Perfect squares
WHY? First of all, it should be clear that if a locker is touched an ODD number of times, it will be open. Secondly, when is a locker touched? When the student’s number is a FACTOR of the locker. That is, locker number 12 is touched by students # 1, 2, 3, 4, 6 and, finally, 12. Since that’s an even number of times, it will be closed in the end. Therefore, we’re looking for locker numbers which contain an ODD number of factors, like 36, whose factors are 1, 2, 3, 4, 6, 9, 12, 18 and 36 (i.e., two of its factors – 6 – are the same number). These are the PERFECT SQUARES. Simple and elegant – that’s Mathematics!