The 100 doors

There are 100 doors, all closed. A group of 100 people will walk through the doors following these rules:

  • If the door they walk through is closed, they will open it, and vice versa.
  • The i-th person will walk through the doors whose number is a multiple of their own number. This means: The first person walks through doors 1, 2, …, 99, 100. The second person walks through doors 2, 4, …, 98, 100, and so on. Which doors will be open at the end?

Solution

Observe that if a door is located at any position n, and if n = p x q, then the p-th person will open the door and the q-th person will close it. This means that if p is not equal to q, the door will always return to its original state (closed). Therefore, only when p equals q will the door remain open. Thus, the doors that will be left open are at the positions: 1×1=1, 2×2=4, 3×3=9, 4×4=16, 5×5=25, 6×6=36, 7×7=49, 8×8=64, 9×9=81, 10×10=100.

Subscribe to SkyGLab

Scroll to Top