This question already has an answer here:
- Product and Sum 2 answers
The Sultan had two wise sages in his service, Ali-ibn-Vali and Vali-ibn-Ali. The Sultan wanted to test their intelligence and told them, "I have thought of two numbers, both are integers greater than 1 and less than 100. I've multiplied them and told the result to Ali. I've added them and told that result to Vali. If you're smart enough, you should be able to discover the original two numbers."
The sages thought for a few minutes, and then:
Ali said," I don't know the original numbers."
"I knew it," Vali replied. (expressing that he knew that Ali didn't know).
"Then I know the numbers," Ali quipped with delight.
"Then I know the numbers too!" exclaimed Vali.
The sages told the original numbers to the Sultan, who was mightily impressed at their intelligence.
Can you determine the original numbers as the sages did?