Wednesday, October 9, 2013

A very long hallway has 1000 doors numbered 1 to 1000; all doors are initially closed. One by one, 1000 people get into the hall; the first person opens each door, the second closes all door with even numbers, the third person closes door 3, opens door 6, closes door 9, opens door 12 etc. That is, the nth person changes all doors whose numbers are divisible by n. After all 1000 people have got into the hall, find out how many doors will remain open.

No comments:

Post a Comment