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). Suppose you continue doing this to every nth locker on pass number n. After 100 passes, where you toggle only locker #100, how many lockers are open?
For a better visual : During the 3rd time you open/close(whatever maybe the case) locker number 3,then locker number 6 and so on until locker 99.The 4th time you do the same i.e:4th locker,then 8th locker....and so on.
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 answer is 10.These 10 lockers are none other than the square numbers till 100,i.e: 1 , 4 , 9 , 16 , 25 , 36 , 49 , 64 , 81 , 100.
The thinking goes in the way that locker numbers with an odd number of factors will always be open and those with an even number of factors will always be closed.Taking number 60 and 36 as examples:
60:- 1 , 2 , 3 , 4 , 5 , 12 , 15 , 20 , 30 , 60.
The above can also be written as :open , close , open , close , open , close , open , close , open , close . As you can see it will be closed . of it.
36:- 1 , 2 , 3 , 4 , 6 , 9 , 12 , 18 , 36.
Looking at the above: open, close , open , close , open , close , open , close, open. As you can see the locker will be open and this likewise will happen for all square numbers. Therefor 10 is the answer.