In a big hostel, there are 1000 rooms. In that hostel, only even numbers are used for room numbers, i.e. the room numbers are 2, 4, 6, ..., 1998, 2000. All the rooms have one resident each. One fine morning, the warden calls all the residents and tells them to go back to their rooms as well as multiples of their room numbers. When a guy visits a room and finds the door open, he closes it, and if the door is closed, he opens it. All 1000 guys do this operation. All the doors were open initially. What is the last door that is closed (room number of that door)?
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.
The rooms which are closed shall be twice a perfect square Last of them will be 2*31²=1922
Perfect square has odd number of factors, if a room was initially open, needs to be closed in the end, it's state has to be changed odd number of times, possible for a perfect square