problem with answer

ZXNet echo conference «zx.talking»

From Vyacheslav Mednonogov To Ally 11 October 2001

Get Msg, Ally! ================================================================================ Posted by: Stanislav Tikhokhod (Slowspeed) ================================================================================ Here's a problem for you. G) A certain king had two wise men: Ali ibn Wali and Wali ibn Ali. Wishing To be convinced of their wisdom, the king called the wise men to himself and said: “I conceived 2 numbers. Both of them are integers, each greater than one. I multiplied these numbers and I will tell Ali the result, and I will tell Vali the sum of these numbers. I'll also tell Ali, that the number that Vali knows is no more than 60. If you are truly wise, what about you They say you can tell me these numbers." The sages thought. First to break Ali's silence: “I don’t know these numbers,” he said, lowering his head. "I am this knew!" - Vali spoke up. “Then I know these numbers,” Ali rejoiced. "Then and I know!" - Vali exclaimed. And the sages reported these numbers to the stricken king. Define them too. ================================================================================ > What is the answer? 13 and 4 > Why? ================================================================================ Well, I thought something like this: Ali says that knowing the work he cannot say the numbers. That is the product is factored in more than one way,which means at least one of the factors is not a prime number (obviously: a non-prime factor itself is factorized and after rearrangement factors in the original product we obtain two other factors). Bali responds to this by saying that he knew this. He can only say that case if the amount known to him obviously cannot be the sum of two prime numbers. All prime numbers are odd, with the exception of two. The sum of two odd numbers is an even number. Accordingly, the amount that is known Bali is an odd number (which ensures that it cannot be obtained from two prime numbers not equal to two) and this sum minus 2 should not give a prime number. Here you can determine many possible amounts (they are less than 60, there will be a little more than a dozen). 11,17,23,27,29,37,... Ali goes on to say that in this case he knows what the numbers are. So he can say because Bali, saying that he knew in advance, gave Ali the opportunity determine this set of amounts. Ali can imagine every possible amount from this set in the form: 11=2+9.3+8.4+7.5+6 (hereinafter symmetrically, ignored) 17=2+15.3+14.4+13,... Further, by multiplying the terms (here I started writing a program :) he can find they contain a work known to him. 11: 2*9=18, 3*8=24, 4*7=28, 5*6=30 17: 2*15=30, 3*14=42, 4*13=52,... (There will be about 200 works in total).The fact that he says, “Then I know” indicates that what he knows the product does not appear after multiplying different amounts in rows (for example, the product cannot be equal to 30 - 11: 5*6 and 17: 2*15) Thus, we can (with the help of a program) cross out all duplicates works (something like hundreds). After which Bali says “then I know too.” This means that after doing the same surgery for the amount known to him he found only one product (52), and this gave him (and we are) 13 and 4. Perhaps the explanation is not entirely clear, but it was enough for me to sufficiently some confidence to be sure of the answer :-) ================================================================================ *Crossposted in 4311.LOCAL *Crossposted in ZX.TALKING *Crossposted in 675.CHAT [I.ZX] [VR1] ----------------------------> Warm greetings, Slava! mailme: copper_feet@mail.ru icq#me: 81191986 [Try our beta -- zone.msn.com/fighterace/news/tbltnewsFA3CommBeta.asp]