Before the process begins, Khoisnam realises that he already knows which lockers will be open at the end. How did he figure out the answer?
Hint: Find out how many times each locker is toggled.
Show solutionHide solution
Label the lockers \(1,2,3,\dots\) in order. Locker \(n\) is toggled once for each divisor of \(n\): it is toggled when the \(d\)-th student acts, for every \(d\) that divides \(n\). So the number of toggles of locker \(n\) equals the number of positive divisors of \(n\).
Starting closed, a locker ends open exactly when it is toggled an odd number of times. Now divisors of \(n\) pair up as \(d\) and \(n/d\). These two are different unless \(d=n/d\), i.e. unless \(n=d^2\). Hence:
- If \(n\) is not a perfect square, its divisors pair off, giving an even number of toggles, so the locker ends closed.
- If \(n\) is a perfect square, one divisor (namely \(\sqrt{n}\)) is left unpaired, so the number of divisors is odd, and the locker ends open.
Therefore Khoisnam knew in advance that the open lockers are precisely the perfect squares: \(1,4,9,16,25,\dots\). He did not need to simulate the toggling; he only had to count divisors and notice the square/non-square distinction.
For example, locker \(12\) has divisors \(1,2,3,4,6,12\) — six toggles, so it ends closed. Locker \(16\) has divisors \(1,2,4,8,16\) — five toggles, so it ends open.