📜 ⬆️ ⬇️

The task of the sages. Decision

image

Everyone knows the task:
Some sultan had two wise men: Ali-ibn-Vali and Vali-ibn-Ali. Wanting to be convinced of their wisdom, the Sultan called the wise men to him and said: “I planned two numbers. Both are whole, each is greater than one, but less than a hundred. I multiplied these numbers and the result will tell Ali and at the same time Vali I will say the sum of these numbers. If you really are as wise as they say about you, you can find out the original numbers. ”

Wise men thought. The first to break the silence of Ali.
“I don’t know these numbers,” he said, lowering his head.
“I knew that,” said Vali.
“Then I know these numbers,” rejoiced Ali.
- Then I know! Exclaimed Vali.
And the wise men told the numbers they had conceived to the defeated king.
')
Call these numbers.

I never found a canonical solution to this problem, so keep my version (with a claim to canonicity).

One of the answers I found: the numbers 2 and 9 (yes, there are several answers). I will try to prove the correctness of the decision.

So, 2 and 9. Ali has a work - 18. At Wali, the sum is 11.

Vali knew that Ali could not guess the numbers. So, multiplying in pairs all possible terms of his sum, he did not get a single product that would allow to guess these numbers.

The main theorem of arithmetic asserts that the decomposition of a number into simple factors is unique, so that the product of two prime numbers always allows one to guess these numbers. Therefore, the Vali sum should not be obtained by adding two prime numbers.

Then, Ali discards those factors, the sum of which can be obtained in this way. The sum of the factors of the number 18 - 3 and 6 - is 9. Also 9 can be obtained by adding 2 and 7 - prime numbers. We reject these factors. Only one pair of factors remains - 2 and 9. Their sum - 11 - cannot be represented as the sum of two prime numbers. Therefore, the initial numbers are 2 and 9.

UPD : I apologize, apparently did not get to the logical end in his reasoning. Thanks shultc.

This is what I missed: after Ali guesses numbers, Vali should guess them. How he does it? Vali multiplies in pairs all possible components of his sum, and then enumerates them. The sought product is the one that has the only one possible sum of its multipliers, which is not the sum of two primes. The multipliers by which Vali received this work are the input numbers.

So I denied my own answer. 3 and 8, 4 and 7, 5 and 6 - all their pairwise works fit the reasoning, therefore Vali could not choose the right one of them.

To find the answer, as I understand it, you can only search. Now the solution must be true.

UPD2 : For completeness, I will cite the answer taken from this article . The initial numbers are 13 and 4. The answer is unique.
PS Go to the article , there is also sorts.

Source: https://habr.com/ru/post/256023/


All Articles