Once a king made a tricky game to test the wit of his neighbour king and the rules were as follows :
Three buildings with exactly number of doors will be made (initially closed).
The doors will be numbered from 1 to 1 to and 1 to respectively in the respective buildings.
The king assigns men to the first building (A), to the second (B) and to the third (C).
Every door numbered has behind it an amount equal to in each of the three buildings.
Procedure: Say for the first building, The 1st man opens all the doors,the 2nd one changes the state of every second door i.e. closes the 2nd,4th,6th,.. numbered doors. The 3rd man changes the state of every third door(opens it if it is closed or vice versa) and it continues till the p-th man repeats the same. This procedure is repeated in all the three buildings.After repeating the process of opening and closing doors finally some doors remained open while some remained closed.
*Condition : * The amount is collected from the opened doors of buildings A,B,C since every open door has some amount behind it (According to rule 4). It is found that the amount collected from A & B is exactly equal to the amount collected from C.
The number of the last door that remained open in 'A' is , in 'B' is and in 'C' is which are found to be squares of prime numbers.
If are respectively the number of those doors for which the condition is fulfilled then enter as your answer.
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.
Suppose there are n doors and the process gets repeated until the n − t h man completes his turn and let D 1 = β 1 , D 2 = β 2 , D 3 = β 3
We are interested to see that how many doors remain open after all of them have alternately shut and opened the doors. To see this, we consider the doors as numbers(however they are already numbered).
Every door is initially open and so a even number of trials on it will make it's state unchanged while a odd number of attempts will make it closed. For example in Door No. 6 since it is opened initially , 2 n d , 3 r d , 6 t h man of the king will try to change the state of the door and for 3 attempts it will ultimately become closed.
We can observe that every door numbered ′ X ′ is being attempted a number of times equal to it's number of divisors except 1 . If we want to find the open doors then Number of divisors except 1 should be even.
For any number n = i = 1 ∏ q p i α i where p i ′ s are its prime factors the number of divisors including the number and 1 is ( α 1 + 1 ) ( α 2 + 1 ) ⋯ ( α q + 1 ) respectively.
So ( α 1 + 1 ) ( α 2 + 1 ) ⋯ ( α q + 1 ) − 1 must be even.
( α 1 + 1 ) ( α 2 + 1 ) ⋯ ( α q + 1 ) must be odd. So each of α i must be even to fulfill this.
So the numbers with even powers of prime facorisation are the numbers who have even number of divisors excluding 1 , which says that those particular doors will remain open.
It is obvious that an even power prime factorisation only reffers to perfect squares, So all the perfect squares below n are numbers for the doors which will remain open after all n trials. Exactly ⌊ n ⌋ number of doors will be open and they will be 1 , 4 , 9 ⋯ , numbered doors.
Now since each door numbered ′ X ′ has an value X so in the first building the doors that are open are 1 , 4 , 9 ⋯ D 1
So Money in A = 1 + 4 + 9 + ⋯ + β 1 = 2 β 1 ( β 1 + 1 ) , Money in B = = 1 + 4 + 9 + ⋯ + β 2 = 2 β 2 ( β 2 + 1 ) , Money in C = 1 + 4 + 9 + ⋯ + β 3 = 2 β 3 ( β 3 + 1 )
Accordingly, β 1 ( β 1 + 1 ) + β 2 ( β 2 + 1 ) = β 3 ( β 3 + 1 ) where β 1 , β 2 , β 3 are prime numbers.
Suppose β 3 = n (A natural number) then the equation is,
β 1 ( β 1 + 1 ) + β 2 ( β 2 + 1 ) = n ( n + 1 ) ⟹ β 1 ( β 1 + 1 ) = ( n − β 2 ) ( n + β 2 + 1 ) since we must have n > β 2
Since β 1 is a prime we must have β 1 ∣ ( n − β 3 ) or β 1 ∣ ( n + β 3 + 1 ) . Now if β 1 ∣ ( n − β 3 ) ⟹ β 1 ≤ ( n − β 2 ) & β 1 + 1 ≤ n − β 2 + 1 and so β 1 ( β 1 + 1 ) ≤ ( n − β 2 ) ( n − β 2 + 1 ) ⟹ ( n − β 2 ) ( n + β 2 + 1 ) ≤ ( n − β 2 ) ( n − β 2 + 1 ) ⟹ n + β 2 + 1 ≤ n − β 2 + 1 which is impossible and thus,
β 1 ∣ ( n + β 1 + 1 ) and for any positive integer k , n + β 2 + 1 = k β 1 and substituting this we have,
β 1 ( β 1 + 1 ) = ( n − β 2 ) ( n + β 2 + 1 ) = k β 1 ( n − β 2 ) ⟹ β 1 + 1 = k ( n − β 2 )
If k = 1 we have β 1 + β 2 + 1 = n & n + β 2 + 1 = β 1 which on subtracting gives n − β 1 = β 1 − n which is absurd and hence k > 1
Since k β 1 − 1 = n + β 2 & β 1 = k ( n − β 2 ) − 1
Consider the identity , 2 β 2 = ( n + β 2 ) − ( n − β 2 ) = k β 1 − 1 − ( n − β 2 ) = k ( k ( n − β 2 ) − 1 ) − ( n − β 2 ) = ( k + 1 ) ( ( k − 1 ) ( n − β 2 ) − 1 )
Since k ≥ 2 ⟹ k + 1 ≥ 3 and 2 β 2 has divisors 1 , β 2 , 2 β 2 , 2 which implies k + 1 = β 2 or k + 1 = 2 β 2 only.
Now equating and getting the solutions we see that ( β 1 , β 2 , β 3 ) = ( 2 , 2 , 3 ) is the only prime solution and hence ( D 1 + D 2 + D 3 ) 2 = 7 2 = 4 9 is the answer.