SOLUTION: The locker problem Imagine a long row of numbered lockers, from 1 to 100 say. The 1st student starts at #1 and goes down the row opening all the lockers. The 2nd student star

Algebra ->  Square-cubic-other-roots -> SOLUTION: The locker problem Imagine a long row of numbered lockers, from 1 to 100 say. The 1st student starts at #1 and goes down the row opening all the lockers. The 2nd student star      Log On


   



Question 1110991: The locker problem

Imagine a long row of numbered lockers, from 1 to 100 say.
The 1st student starts at #1 and goes down the row opening all the lockers.
The 2nd student starts at #2 and changes every 2nd locker: She'll touch locker #2, 4, 6, 8 etc.
If the locker was open, she closes it,
If the locker was closed, she opens it.
The 3rd student starts at #3 and changes every 3rd locker: She'll touch locker #3, 6, 9, 12 etc.
If the locker was open, she closes it,
If the locker was closed, she opens it.
Etc...
Which lockers end up opened? Why?

Answer by KMST(5328) About Me  (Show Source):
You can put this solution on YOUR website!
highlight%28%221+%2C+4+%2C+9+%2C++16+%2C+25+%2C+36+%2C+49+%2C+64+%2C+81+%2C+100%22%29
Lockers that get touched an odd number of times (1, 3, 5, etc) would end up open.
Lockers that are touched an even number of times, will be opened and closed half of that number of times, and will end up closed.
Lockers are touched as many times as their number of divisors.
If the prime factorization of a number is
2%5Ea%2A3%5Eb%2A5%5Ec%2A%22...%22
it will have divisors of the form 2%5EA%2A3%5EB%2A5%5EC%2A%22...%22 , with
0%3C=A%3C=a , 0%3C=B%3C=b , 0%3C=C%3C=c , etc.
As there are a%2B1 choices for A , b%2B1 choices for B , and so on,
the number of divisors is %28a%2B1%29%2A%28b%2B1%29%2A%28c%2B1%29%2A%22...%22 .
The only way for that product to be odd, is for all exponents in the prime factorization to be even.
That happens if and only if the number is a perfect square.