500 lockers A.I.M: all open, then evens closed, then....

chibix3

New member
Joined
Feb 5, 2008
Messages
1
On the first day of school the students of Thomas Jefferson Middle school came up with a plan.The first student into the building opened each of the 500 lockers. The second student closed every even numbered locker. The third student changed every third locker (closed the locker if open, open if closed).The fourth student changed every fourth locker, and so on. when all 500 students had taken a turn, which lockers remained open?

Please help me figure out how to solve this problem :)
 
Re: 500 lockers A.I.M

On the first day of school the students of Thomas Jefferson Middle school came up with a plan.The first student into the building opened each of the 500 lockers. The second student closed every even numbered locker. The third student changed every third locker (closed the locker if open, open if closed).The fourth student changed every fourth locker, and so on. when all 500 students had taken a turn, which lockers remained open?
Lets look at locker number "n". All the lockers are locked to begin with. Since all the lockers are opened on the 1st pass, locker "n" is now open. For locker "n" to be closed on the 2nd pass, n must be divisible by 2. For the locker to be opened on the 3rd pass, it must be divisible by 3. For the locker to be closed on the 4th pass, it must be divisible by 4. Clearly, the locker is either opened or closed as long as the locker number is divisible by each successive divisor of "n". After the one thousandth student has made his contribution to the celebration, locker "n" will only be open if it was acted upon an odd number of times. We can therefore conclude that locker "n" will be open if, and only if, the number "n" has an odd number of factors or divisors. But the only numbers that have an odd number of factors/divisors are the perfect squares. Thus, if "n" is open, it is one of the perfect squares. The lockers that remain open are therefore numbers 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, on up to 961.
 
Top