There is a school with 1,000 students and 1,000 lockers. On the first day of term the head teacher asks the first student to go along and open every single locker, he asks the second to go to every second locker and close it, the third to go to every third locker and close it if it is open or open it if it is closed, the fourth to go to the fourth locker and so on.
The process is completed with the thousandth student. How many lockers are open at the end?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
The only lockers that remain open are square numbers (1,4,9 etc) because these are the only numbers divided by an odd number of numbers. Therefore they will be changed by an odd number of students and left open at the end. Each number with a square root of 31 or less will be left open. 3 2 2 =1024>1000, and is hence out of the question).