Suppose you're in a hallway lined with 100 closed lockers. You begin by opening every locker. Then you close every second locker. Then you go to every third locker and open it (if it's closed) or close it (if it's open). Let's call this action fiddling a locker. Continue fiddling every nth locker on run-through number n. After 100 run-throughs, where you fiddle only locker number 100, how many lockers are open?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
The only lockers that will be open are those with an odd number of factors.
This is because you will only 'fiddle' a locker if the run-through number is a factor of the locker number (and the run-through numbers appear are from 1 - 100 and they only appear once each) , and as the lockers are all closed at the start it will take an odd number of fiddles to have them open.
The only numbers with an odd number of factors are square numbers. There are 10 square numbers from 1 - 100 so there will only be 10 lockers open.