The Locker Puzzle

A forum for good logic/math puzzles.

Moderators: jestingrabbit, Moderators General, Prelates

Posts: 92
Joined: Wed Oct 04, 2006 11:43 am UTC

The Locker Puzzle

Postby rlo » Wed Oct 04, 2006 12:31 pm UTC

A school has a hallway with 100 lockers. All the lockers are closed.

Student one walks down the hallway and opens every locker. Student two walks down the hallway and closes every second locker, starting at locker two. Student three walks down the hallway and changes the state of every third locker, starting at locker three.

In general, student n changes the state of every n-th locker.

After 100 students have passed through the hallway, which lockers are left open?

(This is my favorite puzzle, mostly because the answer is so unexpected!)

Posts: 30
Joined: Wed Aug 30, 2006 8:08 pm UTC
Location: most likely at work

Postby TheReverend » Wed Oct 04, 2006 1:11 pm UTC

I cheated and wrote a program to do it...I see the pattern but I'm struggling with why the pattern is what it is.

Posts: 20
Joined: Thu Jul 20, 2006 9:55 pm UTC

Postby aaronspook » Wed Oct 04, 2006 6:39 pm UTC

I think I have the answer, and it seems pretty easy to arrive at if you just think about the problem in terms of factors.

Posts: 33
Joined: Tue Sep 26, 2006 9:04 pm UTC

Postby jgf » Thu Oct 05, 2006 12:42 am UTC

This is one of my favorite puzzles. Must have first heard it a dozen years ago, and it's getting to the point where I hear "A 1000 lockers/lightbulbs are in a row..." and the answer springs to my head. :)

Monox D. I-Fly
Posts: 76
Joined: Sat Mar 26, 2016 1:49 am UTC
Location: Indonesia

Re: The Locker Puzzle

Postby Monox D. I-Fly » Thu Aug 04, 2016 4:13 am UTC

The lockers with quadratic numbers, right? Because they are the only ones which have odd numbers of factors thus they are left open.

If you know your Forum History, and you clearly don't, you would know that in the time before spoilers, we had puzzle threads and solution threads, and this was solved a long time ago. -jr
Finally found one comic mentioning a Trading Card Game:

Posts: 180
Joined: Sat Feb 13, 2010 8:25 am UTC

Re: The Locker Puzzle

Postby Sandor » Fri Aug 05, 2016 10:45 am UTC

Monox D. I-Fly wrote:...quadratic numbers...

More commonly called "square numbers".

Return to “Logic Puzzles”

Who is online

Users browsing this forum: No registered users and 5 guests