Suppose you're in a hallway lined with 100 closed lockers.
You begin by opening every locker. Then you close every second locker.
Then you go to every third locker and open it (if it's
closed) or close it (if it's open). Let's call this action
toggling a locker. Continue toggling every nth locker
on pass number n. After 100 passes, where you
toggle only locker #100, how many lockers are open?
Answers
Answered by
8
Answer:
10 lockers
Step-by-step explanation:
This problem is based on the factors of the locker number.
The only way a locker could be left open is if it is toggled an odd number of times. The only numbers with an odd number of factors are the perfect
squares. Thus, the perfect squares are left open. Each of these numbers are perfect squares.
Example
Locker number 36 is toggled on pass number 1, 6, and 36 (three toggles): open-closed-open.
Locker numbers which are open are 1, 4, 9, 16, 25, 36, 49, 64, 81, and 100. We can clearly see that each of the above locker numbers are perfect squares.
Similar questions