This is my solution to this problem, given here due to it's length.
Wow, this is such a clever puzzle! However, it's going to be really hard to explain the solution to, so apologies in advance. The more you write out yourself, the easier I think it'll be. For instance, I found that writing lists of numbers and scratching out a number every time they're eliminated really helped.
At the start of the problem, here's what Quacky knows:
- Mario's sum is anywhere from to .
And here's what Mario knows:
- Quacky's product is anywhere from to .
I'll organize this long solution into "rounds" (since we're eliminating things).
Let's start with the first statement. Quacky says, "I don't know the numbers". Here's what we can now say about Quacky's product:
- Quacky's product cannot be prime, since he would instantly know what the two numbers were (every prime's factors are just and itself) for primes less than 9. Primes greater than 9 are also impossible, since one of the numbers will be greater than . So he can eliminate all the primes between and .
- Quacky's product cannot be a number which can only be written as the product of two numbers one way. For example, if Quacky's number was , there would only be one product of two numbers, , since the two numbers cannot be more than . Thus, Quacky would have said he knew what the two numbers were if his product was . He didn't however, so any numbers like this can be eliminated.
If we go through all of Quacky's potential products now and eliminate everything we can, we end up with this list of products: . We've made good progress! :)
Here's what we can also say about Mario's sum:
- If we take each of those five products we just came up with and list all the pairs of numbers they could be made from, we can then take each potential pair and add the two numbers to find a potential sum. For example, the number could be made from or . Adding each pair together, we see that Mario's sum could be either or . If we do this for each potential product, we end up with the following relatively short list of potential sums: .
Next, Mario says, "I don't know the numbers". Here's what we can now say about his sums:
- If we go through each potential sum we just found, we can list the pairs of numbers which could make up that sum and eliminate any with only one pair that works. For example, could be , , , or . But if we try to take the product of each of those pairs, we can see that only one of them, and , would result in a product already in our potential products list (the rest were already eliminated). We can eliminate , , and this way, leaving us with these potential sums: .
Next, Quacky says, "I don't know the numbers" (for the second time). We can now say this about Quacky's products:
- If we go through each potential product, we can list the pairs of numbers which could make up their product and eliminate any with only one pair that works, kind of like last time I guess :). For example, could be or . But the sum of and is , and we've already eliminated from our potential sums. So there's only one pair of numbers which could make , but since Quacky just said he still doesn't know what the two numbers are, the product can't be . Otherwise, he would have said that he knew what the two numbers were. Doing this, we can eliminate , , and , leaving this list of potential products: . Getting close! :)
Next Mario says , "I don't know the numbers" (for the second time). We'll do the exact same process as Round 2 here, eliminating sums with only one possible pair of numbers that work (again, since Mario would know what the two numbers if that was the case). Doing this eliminates , , and , which leaves only two potential sums: .
For the third and final time, Quacky says, "I don't know the numbers". This time we'll repeat the process of Round 3.
- Doing so eliminates and , which means that we now know the product, !
In a surprising turn of events, Mario says, "I know the numbers". How can he say this? Because he now has both Quacky's product and his own sum which he always knew. However, as @pratibha srivastava pointed out, we, the viewers, will never be able to figure out what exactly the two numbers were! We know that Mario's sum is either or , but neither can be eliminated. Thus, the most we can say about the two numbers is that they are either and or and .
And we're done! Like I said, it takes a really long time to explain, but the principles are relatively simple. This has to be one of my absolute favourite puzzles I've ever seen. On the surface, it looks just impossible! Hopefully this solution was clear enough. Feel free to ask for clarification.