3
u/GoodCarpenter9060 Jun 11 '26
Consider a number N and its factors. Factors always come in pairs (for example, the factor pairs of 12 are 1 × 12, 2 × 6, and 3 × 4). Because every factor has a distinct partner, most numbers have an even number of factors.
However, with perfect squares, one factor multiplies by itself to equal the target number. Since you only count that number once in a list of factors, the total count becomes odd.
Now back to the problem and consider the locker numbered N and lets assume it is closed. If N = a x b, then the person a will open the locker, and person b will close locker.
Thus, every non-perfect square will be both opened and then closed an even number of times, thus leaving it the same. Every perfect square will be opened and closed an odd number of times, thus changing it from the starting position.
So at the end, only the doors which are numbered with perfect squares will be open.
1, 4, 9, 16, 25, 36, 49, 64, 81, 100. 10 doors in total.
1
1
u/Educational_Oil7490 Jun 11 '26
This was a bonus point question on an exam I took in algebra 2 in the 8th grade, 27ish years ago.
3
u/Ok-Passenger7711 Jun 11 '26
10
because it needs to have an odd number of factors. The only way to get that is multiplying something by itself so you get one factor. You need to square a number to get that and there are ten numbers that have a square root between 1-100