Locker Riddle

A school has a long hallway of lockers numbered 1, 2, 3, and so on up to 1000. Now, consider the following practice

  • Student #1 walks down the hallway and closes all the lockers.
  • Student #2 walks down the hallway and flips all the even numbered lockers. So now, the odd lockers are closed and the even lockers are open.
  • Student #3 walks down the hall and flips all the lockers that are divisible by 3.
  • Student #4 walks down the hall and flips all the lockers that are divisible by 4.
  • Likewise students 5, 6, 7, and so on walk down the hall in turn, each flipping lockers divisible by their own number until finally student 1000 flips the (one and only) locker divisible by 1000 (the last locker)

After this, what is the state of locker numbered 999 999 ?

open closed

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.

1 solution

Ali Qureshi
Jul 2, 2016

The number of times a locker is touched is equal to the number of factors of the locker number. For example, locker number 6 is touched by student 1,2,3 and 6.

Therefore if the number of factors is even then the locker is open. And if the number of factors is odd then the locker is closed.

We observe that the numbers which are perfect squares have odd number of factors. Therefore only the doors numbered 1,4,9,25,36, ....., 961 remain closed.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...