100 Lockers. Riddle 15 Lvl Easy?

Suppose you're in a hallway lined with 100 closed lockers. You begin by opening every locker. Then you close every second locker. Then you go to every third locker and open it (if it's closed) or close it (if it's open). Let's call this action toggling a locker. Continue toggling every nth locker on pass number n. After 100 passes, where you toggle only locker #100, how many lockers are open?

Nth means "ninth" by the way :3
My apologies, as someone pointed out to me, nth doesn't mean ninth, it's actually like a variable. >.<
I had to go back and look it up to make sure. So pay the first update no mind.


Most Helpful Guy

  • After quite some thinking i got it.

    Here's what happens.

    First, let's agree on the fact that prime numbers will be closed. Because the only factors they have are 1 and the number itself. So, if door opens at 1 , it has to close at the number itself.

    Secondly, all other numbers will have factor , which can be grouped into pairs , for example take number 24, all possible factors are , 1,2,3,4,6,8,12,24 which can be grouped as , 1x24 , 2x12, 3x8, 4x6. If door opens at 1 it will go like
    open close open close open close open close. It closes at the number itself.

    But the exception lies in perfect squares where you have 5x5, 6x6 where u cannot account for 5 or 6 two times, therefore the door remains open.

    1,4,9,16,25,36,49,64,81,100 will remain open.


Have an opinion?

What Guys Said 4

  • Oh god it is math. College calculus logic, don't fail me now!
    Lemme think (I'm actually writing this down on pen and paper too lol)...
    1.) Open all lockers (100 open)
    2.) Open every other locker (50 open, starting with number 1, so the odd numbers)
    3.) Alternate every third locker and stuff.
    Oh geez it is perfect squares. Each one is "toggled" multiple times.
    Let me do some math.

    Umm it'd be 1, 4, 9, 16, 25, 36, 49, 64, 81, 100
    So 10 lockers?
    Uhh, I think?

  • I wrote a C++ computer program to find this out when I was studying programming a few years back... LOL

    I don't remember how it went, though.

  • Deez nutss

  • Ow my brain


What Girls Said 1

Loading... ;