Open, close, open, close, open......

A royal palace has 1000 1000 rooms numbered 1 1 to 1000 1000 . Each room is maintained by a cleaner bearing the room number. Each morning, cleaner number 1 1 will open all the room doors. Cleaner number 2 2 will close all the doors of room with numbers divisible by 2 2 . Cleaner number 3 3 will then approach rooms with numbers divisible by 3 3 . If the room door is opened, he will then close it, if the door is closed, he will then open it. Cleaner number 4 4 will take care of all the rooms with numbers divisible by 4 4 . He will open closed doors and close opened doors.

This process goes on until every cleaner( 1000 1000 cleaners) has done his job. At the end, how many room doors remained open?


The answer is 31.

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.

10 solutions

Peter Bishop
Dec 21, 2013

It's has to do with the factors of numbers.

The number of factors of perfect squares will be odd since one of its factor is its square root.

For example, factors of 36 = (1 , 36) ( 2 , 18) ( 3 , 12) ( 4 , 9) ...and 6 (It cannot be paired because it can only be paired itself ..6,

which is the same number)

And therefore number of perfect squares' factors will always be odd

To keep each door closed, the number of times we open it and the number of times we close it must be equal.

Or, in other words, the number of actions must be even.

And if the number of action is even, then it means that the factors of the door number must even ,too.

And that means only non perfect squares will remain closed.

So to find the number of the room that will remain open, we must find number of perfect square less than 1000

And there 31 [ 1 , 4 , 9 , 16 , 25 , 36 , 49 , 64 , 81 , 100 , 121 , 144 ,......, 961(31^2) ]

So the answer is 31

Nitin Bond
Dec 21, 2013

A perfect square has odd number of factors. Thus, the doors with a perfect square will remain open.

Joel Tan
Dec 21, 2013

Firstly, note that (a) If a room number has an even number of factors, this means that there will be an even number of cleaners opening and closing the door, so it will end up closed. (b) The opposite is true if it has an odd number of factors. Note that if a number, n, has an odd number of factors, it must be a square. Otherwise, for any factor of n, let's say x which less than the square root of n, there will be a corresponding factor different from x, n x . \frac{n}{x}. Thus only perfect squares have an odd number of factors, and there are 31 of them less than 1000 as 3 1 2 < 1000 < 3 2 2 . 31^{2}<1000<32^{2}. So the answer is 31.

Datu Oen
Mar 26, 2014

Let f ( x ) = x f(x) = \left \lfloor {x}\right\rfloor be the greatest integer less than or equal to x x .
We can find the cardinality of perfect square numbers from 1 1 to x 2 x^2 by taking f ( x ) f(\sqrt{x}) .

Example:
There are 10 perfect squares between 1 to 100 (1, 4, 9, 16, 25, 36, 49, 64, 81, 100) since f ( 100 ) = 10 = 10 f(\sqrt{100}) = \left \lfloor {10}\right\rfloor = 10 , while there are only 4 perfect square numbers between 1 to 20 (1, 4, 9 and 16) since f ( 20 ) = f ( 4.47 ) = 4 f(\sqrt{20}) = f(4.47) = 4 .

We take f ( 1000 ) = 31.62 = 31 f(\sqrt{1000}) = \left \lfloor {31.62} \right\rfloor = 31

Saqib M
Dec 23, 2013

Whether the door is closed or open depends on number of times accessed. If it is accessed odd number of times, then it is open while if it is accessed even number of times then it is closed. How many times a door will be accessed depends on the locker number. If it contains odd number of factors - it will be closed. We know that ONLY a perfect square contains odd number of factors. Thus the lockers with perfect square numbers will be open and the number of these perfect squares from 1 to 1000 decides whether a room is open or not. There are 31 perfect squares between 1 to 1000. So, 31 rooms will remain opened.

Debdeep Bhandari
Dec 23, 2013

a door will remain open if it has got odd no .of factors...meaning it will be acted upon odd no of times...so basically only perfect squares has odd no of factrs...so the answer will be no of prfct squres present within 1000 .which is 31 as 32*32=1024 >1000

L de Mendonca
Dec 22, 2013

Whether a door will be open by the end is dependent on the number of factors it has. If it has an even number of factors, an even number of people will approach the door, and so it will remain closed by the end. If it has an odd number of factors, it will be open. However, every number's factors can be listed as pairs: for example, 24 24 can be written as 1 × 24 , 2 × 12 , 3 × 8 1\times24, 2\times12, 3\times8 and 4 × 6 4\times6 . Therefore, most numbers have an even number of factors and their doors will remain closed. However, when doing this with square numbers, one factor is repeated as it is multiplied by itself, for example with 16 16 : 1 × 16 , 2 × 8 1\times16, 2\times8 and 4 × 4 4\times4 . This means that square numbers have an odd number of factors, so only these doors will be open by the end. The highest square below 1000 1000 is 3 1 2 31^2 , so the answer is 31 31 .

Adeeb Zaman
Dec 22, 2013

The first thing that came to my mind is the fact that a door will remain open in the end if and only if it is operated an odd number of times.and as the question suggests, the number of times the i-th door will be operated is equal to the number of divisors i has.So the only task I am left with is to find the number of positive intigers which have odd number of divisors. Now,most of the positive integers have an even number of divisors. This is because, generally, if 'i' is divisible by 'a', then there should exist another integer 'b' such that a*b=i.Thus, divisors come in 'pairs'.But this is not true for perfect squares.If 'i' is a perfect square i.e. i= c^2, then dividing 'i' by 'c' gives 'c', which is not a new divisor.So a perfect square can not have even number of divisors. So, for this problem, we need to find the number of perfect squares less than 1000.taking the floor of the square root of 1000,we get the answer 31.

If it ends with the door open, then the quantity of divisors of that number is odd. A number with an odd quantity of divisors is forced to be a perfect square, because when we factorize a perfect square, there will be always a factor repeated (the root). For example, 9 = 1 9 = 3 3 9 = 1 \cdot 9 = 3 \cdot 3 . From 1 1 to 1000 1000 there are 31 31 perfect squares, and so our answer is 31 \boxed {31} .

Devansh Shringi
Dec 21, 2013

try at small scale of upto 10 or observe that door numbered such that it has odd number of divisors is open . All perfect square numbered doors are open. hence the ans is 31.

and by the way it is technotholon question

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...