There are doors in a corridor. There are persons as well. Initially all the doors are closed. The first person goes and opens all the doors. The second person goes and closes all the even numbered doors. The third person goes and toggles the state of all the doors which are a multiple of ( If it is open, the third person closes it and vice versa). Finally, The thousandth person goes and toggles the state of all the doors which are a multiple of . Eventually how many doors will be open?
This problem is a part of Tessellate S.T.E.M.S (2019)
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
All doors will be opened and closed once for each of their number's divisors. Divisors usually come in pairs, so the door with number n = p ⋅ q , p < q will be opened by tbe p th person and closed again later by the q th person. The only numbers whose divisors don't come in pairs are the square numbers, because person p = n ∈ N won't have a partner q who closes the door again, because q = p .
So, the question comes down to the number of perfect squares less than or equal to 1000, which is easy to compute as ⌊ 1 0 0 0 ⌋ = 3 1 .