1000 students with numbers form 1 to 1000 are at a school and they each have a locker numbered 1 to 1000. All the lockers are closed at the start. If each student changes the state (closes if it is open or opens if it is closed) of all the lockers divisible by their number, how many lockers are left 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.
All the lockers that are open are the ones with an odd number of factors, and they can only be perfect squares. 31x31=961 and 32x32=1024, so there are 31 perfect squares under 1000, and hence the answer.