Geeks Talk

Prepare for your Next Interview




Lockers...

This is a discussion on Lockers... within the Aptitude Skills forums, part of the Brain Gym category; There are 1000 lockers in a high school with 1000 students. The problem begins with the first student opening all 1000 lockers; next the second student closes lockers 2,4,...


Go Back   Geeks Talk > Brain Gym > Aptitude Skills

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-04-2007
Expert Member
 
Join Date: Jun 2006
Location: India
Posts: 411
Thanks: 15
Thanked 32 Times in 24 Posts
jamesravid is on a distinguished road
Lockers...

There are 1000 lockers in a high school with 1000 students. The
problem begins with the first student opening all 1000 lockers; next
the second student closes lockers 2,4,6,8,10 and so on to locker 1000;
the third student changes the state (opens lockers closed, closes
lockers open) on lockers 3,6,9,12,15 and so on; the fourth student
changes the state of lockers 4,8,12,16 and so on. This goes on until
every student has had a turn.

How many lockers will be open at the end? What is the formula?
__________________
Cheers,
:) James:)
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-06-2007
Contributing Member
 
Join Date: Sep 2006
Location: bangalore, india
Posts: 1,007
Thanks: 0
Thanked 71 Times in 60 Posts
psuresh1982 will become famous soon enough
Re: Lockers...

For example the 18th locker will be visited by those students whose numbers are factors of 18. i.e. by numbers 1,2,3,6,9,18. This is 6 students (an even number) and this means the locker will in turn be
open/closed/open/closed/open/closed. Now all numbers with an even number of factors will end up closed. And all numbers EXCEPT PERFECT SQUARES have an even number of factors if we include 1 and the number itself. For a perfect square, say 16, we have factors 1,2,4,8,16, an odd number, and the lockers would be open/closed/open/closed/open.

So perfect squares always have an odd number of factors, and all other numbers have an even number of factors.

Lockers that are open are 1, 4, 9, 16, 25, 36, .....

So total number of lockers that are open is 31.

--------------------
suresh
Reply With Quote
The Following User Says Thank You to psuresh1982 For This Useful Post:
Reply

  Geeks Talk > Brain Gym > Aptitude Skills


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
How many lockers are then opened? debleena23 Brainteasers 2 05-09-2007 01:51 AM


All times are GMT -4. The time now is 01:41 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved