Monday, September 19, 2016

Locker Problem


Here is the locker problem. There are 1,000 lockers and 1,000 kids. The first kid ran down the hallway and opened all of the lockers. The second kid ran down the hallway and changed the state of every locker. The third kid ran down the hallway and changed the state of every third locker.The fourth kid ran down the hallway and changed the state of every fourth locker. The fifth kid ran down the hallway and changed the state of every fifth locker, and so on.

First I decided to do the problem from lockers 1-30 because doing 1-100 is going to take too much time. I crossed out every second locker to show that the locker is closed. Then I did every third locker, every fourth, every fifth locker, and so on. After doing that I realised that lockers 1, 4, 9, 16, and 25 were all left open. I figured out that they are all square numbers. The square numbers all have a uneven number of factors because one factor multiplies itself by itself to get the square number.So, the last locker number open is 961.


No comments:

Post a Comment