14 Mar 2026

Imagine a hallway with 100 closed doors, all of which are initially closed. The first person to come opens them all, the second one changes the state of every other door, the third one does this to every third door, and so forth until the hundredth changes the hundredth door. At the end of this process, which doors remain open?

Proposed by Julio Mulero on behalf of the RSME, on the occasion of the International Day of Mathematics.

Phrasing the statement into mathematical terms, one can see that the ith person opens the jth door if and only if i divides j; thus the problem becomes studying which numbers have an odd number of divisors.
Recall now the fundamental theorem of arithmetic, which states that each natural number n can be factored as a unique product of powers of primes, that is, n=i=1kpiαi=2α13α2. Prime numbers are the building blocks of the natural numbers, so for a number to be a divisor of n, it must have smaller or equal αi's than n when factorized, which therefore leaves a total of d(n)=i=1k(αi+1). We want this product to be odd, so each individual factor must be odd itself – otherwise the entire expression becomes even –, hence each αi is even, so n is a perfect square! The converse is also true, since each perfect square has squared primes as factors. Therefore, since there are 10 perfect squares between 1 and 100, namely 1, 4, 9, 16, 25, 36, 49, 64, 81, and 100, these positions will stay open at the end.