Count Doors
Assume that all doors are closed at first.
1. First person will open all the doors.
2. Second person visits all doors whose number is divisible by 2. And on those rooms he will close the door if it is open and open the door if it is close.
3. Third person visits the doors whose number is divisible by 3. And on those rooms he will close the door if it is open and open the door if it is close.
.
.
.
4. 1000th person visits the door having 1000 number (because that’s the only door whose number is divisible by 1000). He will open the door if it is close and he will close the door if it is open.
Find the number of doors that will be open at end of above process. Explain the logic behind the result.
-Pradeep