The Secret: Factors and Toggles
Did you notice the pattern?
Key Insight: Locker #N is toggled by Person K only if K is a factor of N.
Locker #6 toggled by: Person 1, 2, 3, 6 Because 1, 2, 3, 6 are factors of 6!
This section is still being documented. Clone the project to customize it or keep reading for context.
Part of NCERT 8 Math
An ancient puzzle about lockers, factors, and perfect squares

Queen Ratnamanjuri of ancient Manipur had amassed a legendary fortune of precious ratnas. As she wrote her final will, she devised a puzzle that would reveal who truly deserved her treasure.

"Inside ONE of these lockers lies the entire fortune," announced the minister. "If someone solves this puzzle first, they keep EVERYTHING. Otherwise, it's shared equally among all 100 of you."

Person 1 OPENS all 100 lockers. Person 2 TOGGLES every 2nd locker (2,4,6...). Person 3 TOGGLES every 3rd (3,6,9...). Toggle means: if open → close it, if closed → open it.

Each person toggles ONLY the lockers that are multiples of their number. Person 4 toggles 4,8,12... Person 10 toggles 10,20,30... Person 100 only touches locker #100. The tension builds with each turn.

While everyone else scrambled to figure out the answer, young Khoisnam sat peacefully. He had discovered a secret pattern: the answer was hidden in FACTORS and PERFECT SQUARES. What did he see that others missed?

Locker #12 has factors 1,2,3,4,6,12 — that's 6 toggles (EVEN) → CLOSED. But Locker #9 has factors 1,3,9 — only 3 toggles (ODD) → OPEN! Why does 9 have an odd count? Because 3×3 counts as just ONE factor!

Only 10 lockers remain open: 1, 4, 9, 16, 25, 36, 49, 64, 81, 100 — all PERFECT SQUARES! These are 1², 2², 3², 4², 5², 6², 7², 8², 9², 10². Khoisnam claimed the treasure by understanding the mathematics of factors.
Understanding why perfect squares have odd number of factors
Did you notice the pattern?
Key Insight: Locker #N is toggled by Person K only if K is a factor of N.
Locker #6 toggled by: Person 1, 2, 3, 6 Because 1, 2, 3, 6 are factors of 6!
Test your understanding of the locker problem
In the 100 lockers problem, how many times is Locker #12 toggled?