# Finding a mystery number from a sum and product, with a twist

At a party of perfect logicians, Alzim and Era each select a positive integer and and report the number to Mufti.

Mufti writes the sum of the two numbers on a card and the product on another card. Mufti hides one of the cards and shows the other card--which displays the number 2020--to both Alzim and Era.

Mufti asks Alzim and Era if either knows the other's number.

Alzim states, "I do not know Era's number."

Era replies, "I do not know Alzim's number."

A perfect logician nearby has been overhearing the entire game and blurts out, "I know Era's number!"

So, what number did Era choose?

Source: translated and slightly re-worded from a 2018 math competition in Indonesia by Gajah Mada University.

Question 15 in this pdf:

Era chose:

$$1010$$

There are two cases:

Either $$2020$$ is the sum, or it is the product.

For simplicity, here are the factors of $$2020$$:

$$1, 2, 4, 5, 10, 20, 101, 202, 404, 505, 1010, 2020$$

Now

Alzim does not know Era's number. This means they must have chosen a number that is a factor of 2020, as if they had not, then they would have known 2020 must have been the sum - and hence could deduce Era's number.

However, Era also doesn't know Alzim's number, so by the same logic must have picked a factor.

But

Era also knows Alzim picked a factor from their answer, as they answered first. As they still don't know Alzim's number, they must have picked a number where there is a factor such that the sum of the numbers is $$2020$$, as well as a different factor that multiplies to $$2020$$ as well.

So, the perfect logician overhearing everything deduces all this and works out that

Era must have chosen $$1010$$, and they are unsure whether Alzim also chose $$1010$$, or chose $$2$$

Era has:

1010, and we cannot know if Alzim has 2 or 1010.

We can analyze this bit by bit:

Since after revealing the number 2020, Alzim doesn't know the Era's number, it must mean that his number is one of the divisors of 2020, so he doesn't know if 2020 is the product or the sum. Had his number not been a divisor of 2020, then 2020 could only be the sum since both their numbers are integers. Knowing this, we can restrict Alzim's number to 1, 2, 4, 5, 10, 20, 101, 202, 404, 505, 1010, 2020.

Since everyone present are perfect logicians, they must have realized this too, including Era. However, she still claims she doesn't know Alzim's number, meaning that her number can make 2020 either by sum or by product with one of the divisors above, so she's not sure. Looking around, the only number that fits is 1010, since 1010 + 1010 = 2020, and 1010 * 2 = 2020, and both 1010 and 2 are one of the divisors above. No other numbers can work like this. Say, if Era had 4 so that 4 * 505 = 2020, but since 4 + 2016 = 2020 and 2016 is not one of the divisors above, it doesn't work.

Assuming the puzzle is fair and has no mistakes, we, the reader, can solve it without

needing to know or calculate the full list of divisors of 2020.

Why?

After Era's reply we have two pieces of information about Era's number:

1. Era's number is a divisor of 2020.
2. There is a divisor of 2020 that can be added to Era's number to make 2020.

There is one obvious candidate that fits these criteria: half of 2020, or 1010. But we can't be sure that this is Era's number unless this is the only possible option.

However,

after the eavesdropping logician chimes in, we get an additional piece of information: that a perfect logician was able to deduce Era's number from the same information we have. Therefore, there must be only one number that fits both criteria. Since we know 1010 fits the criteria, this must be the only option, and therefore must be the answer.

Note that

like the other answers demonstrate, we can solve the puzzle without the eavesdropping logician's comment, but what their comment gives us is the ability to use this reasoning to bypass having to check all of 2020's divisors.

• We don't need either the eavesdropping logician or the factors. ROT13: Gur bayl jnl gb rkcerff nal ahzore nf gur fhz bs gjb bs vgf snpgbef vf vs obgu ner unys gur bevtvany ahzore. Pyrneyl arvgure rdhnyf gur ahzore vgfrys, naq nal bgure pbzovangvba bs snpgbef vf gbb fznyy. Commented Jun 21 at 11:06
• Good point, I suspected that this might be the case but wasn't sure. It's still not exactly clear to me why rot13(nal bgure pbzovangvba bs snpgbef zhfg arprffnevyl or gbb fznyy), but I believe it. Commented Jun 22 at 17:39