Lockers Puzzle

A high school has a strange principal. On the first day, he has his students perform an odd opening day ceremony:

There are one thousand lockers and one thousand students in the school. The principal asks the first student to go to every locker and open it. Then he has the second student go to every second locker and close it.The third goes to every third locker and, if it is closed, he opens it, and if it is open,he closes it.The fourth student does this to every fourth locker, and so on. After the process is completed with the thousandth student, how many lockers are open?


open lockers are perfect squares 1, 4, 9, 16, 25........ they are the only numbers divisible by an odd number of whole numbers.
every factor other than the number's square root is paired up with another.
so these lockers will be "changed" an odd number of times.
which means they will be left open.
All the other numbers are divisible by an even number of factors and will consequently end up closed.

the number of open lockers = the number of perfect squares less than or equal to 1000.
numbers are 1 squared, 2 squared, 3 squared, 4 squared, and so on, up to 31 squared. 32 squared>1000
out of range.
ans is 31

so answer is 31

No comments:

Your Title

My Blog List