School is about to begin. The janitor has all the lockers closed. All 1000 of them.
Student #1 comes along and opens ALL of the lockers.
Student #2 comes along and closes doors 2, 4, 6, 8, 10, etc....
Student #3 comes along and changes the state of every 3rd locker ( 3, 6, 9, 12, 15).
Student #4 comes along and changes the state of every 4th locker (4, 8, 12, 16).
Student #5 comes along and changes the state of every 5th locker (5, 10, 15, 20)
Student #6 comes along and changes the state of every 6th locker (6, 12,18. 24)
It keeps going until all 1000 students go through. What lockers are closed?