There is a wall with 1000 closed lockers on it. A person walks down the hall opening every other locker. Then the next person opens every 3rd locker. The next opens every fourth locker. The next every fifth locker.
Once this has been done, how many lockers are still closed?
The 2nd person opens every 3rd that's still open. So he opens 500 -floor(500/3) = 500- 166 = 334
The 2nd person opens every 4th that is still open. So, he opens 334 -floor(334/4)
= 334-83 = 251
The 3rd person opens every fifth that's still open. Son he opens 251 - floor(251/5) = 251-50= 201.