日本語
One Hundred Lockers (illustration)
FILE No.53Unsolved

One Hundred Lockers

Difficulty ★★☆about 5 minLogic PuzzleDivisorsSquare numbers
One hundred closed lockers are operated by one hundred people in turn. How many are open at the end?

Case Record

In a warehouse, one hundred lockers are lined up, numbered 1 to 100. At first they are all closed.

One hundred people then come one at a time and operate the lockers. The 1st person opens every locker once. The 2nd person toggles the lockers that are multiples of 2: closes each one that is open and opens each one that is closed. The 3rd person toggles the multiples of 3 in the same way. This continues up to the 100th person.

When the 100th person had finished operating only locker 100, the jewels turned out to be in a locker that was left open.

Your question

How many lockers are open at the end in total?

Case Files

Evidence

Diagram

Locker number and divisorsNo.DivisorsToggles61, 2, 3, 64 (closed)91, 3, 93 (open)161, 2, 4, 8, 165 (open)101, 2, 5, 104 (closed)An odd number of toggles means it ends open.
Diagram

Timeline

  1. All one hundred lockers are closed.
  2. One hundred people operate them one by one.

Hints

If you get stuck, open the hints one at a time, in order.

Open hint 1

How many people operate locker n?

Open hint 2

What kind of number has an odd number of divisors?

Open hint 3

How many such numbers are there from 1 to 100?

Solve It

Your question

How many lockers are open at the end in total?

Choose the answer closest to the truth.

Share: I'm solving this

The Truth

10

The answer is 10.

Locker n is operated by the people whose numbers are divisors of n. If it is operated an odd number of times, it ends open. The only numbers with an odd number of divisors are square numbers (because divisors normally come in pairs).

The squares from 1 to 100 are 1, 4, 9, 16, 25, 36, 49, 64, 81 and 100, ten in all. Only these ten lockers are open at the end.

Only square numbersOpen lockers (10 in all)1, 4, 9, 16, 25, 36, 49, 64, 81, 100
Diagram of the solution

Key Points

  • Think "number of toggles = number of divisors"
  • Divisors normally come in pairs (square numbers are the exception)
  • Count the square numbers from 1 to 100

Why people get fooled

You try to follow all hundred people’s operations and miss the structure of the number of divisors.

Similar tricks

  • The type that thinks in numbers of divisors
  • The type that finds a pattern

If you like this file, try these

Three Umbrellas Mixed Up (illustration)Three Umbrellas Mixed Up★★☆about 4 minThree Switches, One Bulb (illustration)Three Switches, One Bulb★★☆about 5 minThree Statements, Only One Liar (illustration)Three Statements, Only One Liar★★☆about 5 minThe Fall at the Mountain Pass Shrine (illustration)The Fall at the Mountain Pass Shrine★★☆about 5 min

If you view the truth, this case will not count as solved on your own. Open it anyway?

Privacy Policy (Japanese)

The cases on this site are fictional puzzles created for entertainment. Any resemblance to real people, organizations or events is coincidental.

© Unsolved Files