Monday, September 14, 2026

The locker problem

To approach problems that don’t exactly have a clear start, I always like to do a smaller example base case, which I decided on a sample of 6. 

I noticed that only 1 and 4 were closed, while the other lockers were open. Intuitively, I could tell the factors of each number were determining the end result of each locker; thus, I wrote out the factors of each one and noticed the numbers with an odd number of factors were the ones locked. I added a few more examples (7,8,9) to make sure. 


Plus, when I was thinking of what bigger numbers could have an odd number of factors, I could only think of numbers where a factor is repeated, like 49, 7x7. So another interesting aspect is that all the locked lockers are likely square numbers, as they would need a factor pair of n x n. 


Overall, I concluded that the open lockers are lockers with an even number of factors, and the locked lockers are numbers with an odd number of factors.



No comments:

Post a Comment