Queen Ratnamanjari’s locker puzzle
Queen Ratnamanjari left her fortune in a secret room with \(100\) lockers. Khoisnam (her son) and \(99\) relatives take turns interacting with the lockers to find the treasure.
THE RULES:
- Person \(1\) opens every locker.
- Person \(2\) toggles every \(2\)nd locker (closes the open ones).
- Person \(3\) toggles every \(3\)rd locker (\(3\)rd, \(6\)th, \(9\)th...)
- This continues until all \(100\) people take their turn.
THE MYSTERY: In the end, only a few lockers remain open. The open lockers reveal the passcode to the safe. Which ones are they?
A locker stayed open only if it was toggled an odd number of times.
Khoisnam knew the answer before the game even started. He realized these aren’t just random numbers. They belong to an elite mathematical family.
Let us investigate further:
As the locker stayed open if it was toggled an odd number of times, think about the numbers that have an odd number of factors.
Number of factors of \(1 = 1\) (So, \(1\) has an odd number of factors.)
Number of factors of \(2 = 2\) (Even number of factors.)
Number of factors of \(3 = 2\) (Even number of factors.)
Number of factors of \(4 = 3\) (odd number of factors.)
Number of factors of \(5 = 2\) (Even number of factors.)
If we continue this calculation, we can find more numbers with an odd number of factors, such as \(9, 16, 25, 36, 49, 64, 81\) and \(100\).
Thus, the numbers that have odd number factor up to \(100\) are \(1, 4, 9, 16, 25, 36, 49, 64, 81, 100\). These are not random numbers. They belong to the elite mathematical family called 'PERFECT SQUARE NUMBERS'.
OPEN LOCKER \(\iff\) Locker number has an odd number of factors \(\iff\) The number is a PERFECT SQUARE.
Use this simulation to remember ratnamanjari.html treasure and recall the square numbers up to \(100\).
Square Numbers:
A square number is a number that can be written as a number multipliedby itself.
Let's see the visual representation of square numbers. Look at the pattern below carefully.


In the above pattern:
The first picture has \(1\) row and \(1\) column.
The second picture has \(2\) rows and \(2\) columns.
The third picture has \(3\) rows and \(3\) columns.
The fourth picture has \(4\) rows and \(4\) columns.
\(1 \times 1 = 1^2 = 1\)
\(2 \times 2 = 2^2 = 4\)
\(3 \times 3 = 3^2 = 9\)
\(4 \times 4 = 4^2 = 16\)
Here, we multiply the number by itself, and we obtain a square of that number.
The numbers \(1\), \(4\), \(9\) and \(16\) are called square numbers.

We write \(n × n\) as \(n²\). It is read as “n squared”.
Example:
- \(4 = 2 × 2\),
- \(6.25 = 2.5 × 2.5\),
- \(16 = 4 × 4\)
Important!
The squares of natural numbers are called perfect squares. For example, \(1, 4, 9, 16, 25, …\) are all perfect squares.
It is recommended to learn the square numbers of the first \(30\) natural numbers to facilitate easy calculation in the future.
| Number \(n\) (\(1-10\)) | Square Number \(n^2\) | Number \(n\) (\(11-20\) | Square Number \(n^2\) | Number \(n\) (\(1-10\)) | Square Number \(n^2\) |
| \(1\) | \(1^2=1\) | \(11\) | \(11^2=121\) | \(21\) | \(21^2=441\) |
| \(2\) | \(2^2=4\) | \(12\) | \(12^=144\) | \(22\) | \(22^=484\) |
| \(3\) | \(3^2=9\) | \(13\) | \(13^2=169\) | \(23\) | \(23^2=529\) |
| \(4\) | \(4^2=16\) | \(14\) | \(14^2=196\) | \(24\) | \(24^2=576\) |
| \(5\) | \(5^2=25\) | \(15\) | \(15^2=225\) | \(25\) | \(25^2=625\) |
| \(6\) | \(6^2=36\) | \(16\) | \(16^2=256\) | \(26\) | \(26^2=676\) |
| \(7\) | \(7^2=49\) | \(17\) | \(17^2=289\) | \(27\) | \(27^2=729\) |
| \(8\) | \(8^2=64\) | \(18\) | \(18^2=324\) | \(28\) | \(28^2=784\) |
| \(9\) | \(9^2=81\) | \(19\) | \(19^2=361\) | \(29\) | \(29^2=841\) |
| \(10\) | \(10^2=100\) | \(20\) | \(20^2=400\) | \(30\) | \(30^2=900\) |
Reference:
National Council of Educational Research and Training (2025). Math - Standard 8. Ganita Prakash, Part I. A square and a cube - 1.1 Queen Ratnamanjuri puzzle (pg. 1-3). Published at the Publication Division by the Secretary, National Council of Educational Research and Training, Sri Aurobindo Marg, New Delhi.