The School Locker Problem
The students lined up according to their locker number in ascending sequence from 1 to 1000.
The first student, Locker 1, went down the whole row of 1000 lockers and, starting at Locker 1, opened every locker door.
The second student, Locker 2, started at the second locker and closed every second locker door.
The third student, Locker 3, started at the third locker and closed the door, then proceeded to either open or close every third locker as required.
And so it continued with each student starting at their locker “N” and proceeding to the next “Nth” locker, either opening or closing the locker door as required. If the locker door was closed when they arrived, they opened it. If the locker door was open when they arrived, they closed it. But they looked at only every “Nth” locker door.
This process continued until all 1000 students had performed the task.
how many doors were open, how many were closed, and why?