Monday, September 11, 2023

Response to the locker problem

Instead of looking at all the lockers and using brute force to see a pattern, I looked at a specific locker. I asked “What would cause this locker to be open/closed.” I realized that a locker would be closed if an odd number of people interacted with it, and open if an even amount of people interacted with it.

If each locker was numbered from 1-1000, the number of people interacting with the locker would be equal to the number of factors the locker number has!

If the number of factors is even, the locker is open. If the number of factors is odd, the locker is closed.

This begs the question, which numbers have an odd number of factors? My first thought was prime numbers! Because they would only be visited by their own number. I recognized my mistake quickly; primes are divisible by ONE AND themselves.

I recognized that squares have an odd number of factors, or at least an odd number of distinct factors. For example, 9= 3x3, but 3 is distinct! In more depth, the factors of 9 are 1, 3, 9; an odd number!

I did a quick check by drawing out a list of lockers, and my prediction was confirmed. The square numbers were left closed.