The Corridor of 500 Lockers

A school corridor contains 500500 lockers numbered 11 through 500500, and every door starts open. Then 500500 students file through one at a time: student nn (for n=1,2,…,500n = 1, 2, \dots, 500) flips the state of every locker whose number is a multiple of nn — closing it if open, opening it if closed. So the first student flips every locker, the second flips lockers 2,4,6,…2, 4, 6, \dots, and so on through student 500500. Once everyone has passed, how many lockers stand open?

Answer

The worked solution is free with any TraderPrep account.