All Problems
Problem #10 HARD

The Infinite Hallway of Lockers

Microsoft Math Pattern Recognition

Problem Statement

A school hallway contains 100 closed lockers, numbered 1 to 100. A student walks down the hall and opens every locker. A second student walks down and closes every second locker (2, 4, 6, ...). A third student changes the state of every third locker (3, 6, 9, ...), opening it if it was closed, and closing it if it was open. This process continues until 100 students have walked down the hallway. After the 100th student finishes, which lockers will remain open?

Answer & Quick Explanation

Logged-in Users Only

You must be logged in to view the answer and check your solution. Signing up is free and takes less than a minute.

Detailed Editorial Solution

Detailed Editorial Solution is Premium

Unlock detailed step-by-step mathematical proofs, logic explanations, and company-specific interview preparation pathways.