283.A Thousand Doors
★★★combinatoricsSIG
A corridor has 1000 closed doors numbered 1 to 1000. Guard 1 walks past and opens every door. Guard 2 toggles every 2nd door, guard 3 toggles every 3rd door, and so on, through to guard 1000 who toggles only door 1000. Toggling means opening a closed door or closing an open one. How many doors are open at the end?
Sign in to submit an answer and track it toward your stats.
Sign inHint
Door n is touched once by each guard whose number divides n. So the question is really about the parity of the number of divisors.
Want timed drills, mental math, and a market-making game too? Try the full practice suite →