All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Lockers (Posted on 2002-12-06)
There is a wall with 1000 closed lockers on it. A person walks down the hall opening every other locker. Then the next person opens every 3rd locker. The next opens every fourth locker. The next every fifth locker.

Once this has been done, how many lockers are still closed?

 See The Solution Submitted by Erin Rating: 3.0000 (7 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 Formula | Comment 9 of 10 |

Also, for x lockers, the number of closed lockers is:

x-int(x/2)-int(x/3)-int(x/5)+int(x/6)+int(x/15)+int(x/10)-int(x/30)

I ignored the every 4th locker since no lockers were opened.
The "+" terms add back the lockers counted twice that shouldn't have been.  Every 30th locker got added 3 times AND subtracted 3 times, so we have to subtract every 30th locker once more, accounting for the last term.

Works out to 266.
As x gets larger the fraction of closed lockers approaches 4/15 of the total number.

 Posted by Larry on 2005-06-13 02:49:18

 Search: Search body:
Forums (1)