DoRiddles
RiddlesQuizzesChallengeLeaderboard
0 XPSign In
All Riddles
EasyMediumHard
Daily Riddle
DoRiddles

A growing collection of logic puzzles, brain teasers, and mind-bending riddles — each with hints and explanations to keep your mind sharp.

Riddle Categories

  • Logic Puzzles
  • Math Riddles
  • What Am I?
  • Funny Riddles
  • Tricky Riddles
  • Easy Riddles
  • Medium Riddles
  • Hard Riddles

Popular Topics

  • Animals Riddles
  • Food Riddles
  • School Riddles
  • Love Riddles
  • Nature Riddles
  • Water Riddles
  • Christmas Riddles

Brain Training

  • Brain Teasers
  • Trivia Questions
  • Trick Questions
  • Would You Rather
  • Tongue Twisters
  • Fun Facts
  • Daily Challenge
  • Quizzes

Company

  • About DoRiddles
  • Contact Us

Riddles For

  • Adults
  • Kids
  • Teens

© 2026 DoRiddles Inc. All rights reserved.

PrivacyTermsSitemap
  1. Brain Teasers
  2. There are 100 lockers in a hallway, all closed. 10…
Brain Teaser🔴 hardMath

There are 100 lockers in a hallway, all closed. 100 students walk by one at a time. The first student opens every locker. The second student closes every 2nd locker. The third student toggles every 3rd locker. This continues for all 100 students. Which lockers are open at the end?

Share:

Only the perfect square numbered lockers: 1, 4, 9, 16, 25, 36, 49, 64, 81, 100

Why this works

At first glance, this riddle might seem like a perplexing puzzle of chaos, but it reveals a fascinating pattern rooted in mathematics. The key lies in understanding how the lockers are toggled open and shut with each student's actions. Each locker is opened or closed based on its divisors; for example, locker number 12 is toggled by students 1, 2, 3, 4, 6, and 12. This means a locker will end up open only if it has an odd number of total divisors, and the only numbers that meet this criterion are perfect squares. Why? Because divisors typically come in pairs (like 1 and 12, 2 and 6), but a perfect square, such as 9, has a central divisor that repeats (3 in this case), resulting in an unpaired divisor. This riddle not only entertains but also showcases the beauty of numbers and their properties. It invites us to explore the world of mathematics in a playful way, leading to that delightful “aha moment” when the realization dawns that only the lockers numbered with perfect squares—1, 4, 9, 16, and so on—remain open. This clever twist highlights how seemingly simple actions can lead to intricate outcomes, revealing deeper truths about the nature of numbers. Fun fact: this kind of riddle is a classic example of a mathematical problem that has been enjoyed for centuries, often found in recreational mathematics, where logic and number theory combine to create engaging challenges!

❌

Common Wrong Answers

“All lockers are open”

This is incorrect because the toggling process means many lockers will be closed after the students pass, specifically those that are not perfect squares.

“Only the odd numbered lockers are open”

This is wrong because the pattern of opening and closing the lockers does not depend solely on whether a locker number is odd or even, but rather on the number of times each locker is toggled, which is determined by its divisors.

“Lockers 1 to 50 are open”

This guess is incorrect because, while some lockers within that range may be open, many will be closed due to the toggling pattern, and specifically, only perfect squares remain open.

More Brain TeasersBrowse all riddles

Similar Brain Teasers

More brain teasers you might enjoy

hardBrain Teaser

A windowless room contains three identical light fixtures, each containing an identical light bulb. Each light is connected to one...

Solve
easyBrain Teaser

What has many keys but can't open any locks?

Solve
hardBrain Teaser

If you wrote all the numbers from 1 to 100, how many times would you write the digit 9?

Solve
easyBrain Teaser

I have keys but no locks. I have space but no room. You can enter but can't go inside. What am I?

Solve
Previous

What gets wetter the more it dries?