100 Doors

100 closed lockers. You begin by opening all 100 lockers. Next, you close every second locker. Then you go to every third locker and close it if it is open or open it if it is closed (call this toggling the locker). After your 100th pass of the hallway, in which you toggle only locker number 100, how many lockers are open?


If a number has an even number of *distinct* factors, then the door with that number will be flipped an even number of times.  All numbers including prime numbers have an even number of factors except the perfect squares. The doors whose numbers are perfect squares have an odd number of  distinct factors. So those doors will be flipped an odd number of times. Since the initial state of all doors was “Closed”, those doors that are perfect squares will be flipped to “Open”. There are 10 numbers less than or equal to 100 that are perfect squares. So the answer must be 10 doors??

  1. Emily says:

    what do you mean by “distinct”?

  2. by the word ‘distinct’ what I mean is, “Non repetitive factors”. For example when u factorize 25 we get 1,5,5,25 as factors. But distinctly 1,5,25 totally 3 which is odd. Similarly all perfect squares have odd number of distinct factors. Hope you got it. 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s