Two integers \(x\) and \(y\) are chosen such that
\[
2 \le x \le y,\qquad x+y \le 100.
\]
Player \(A\) is told the sum
\[
S=x+y,
\]
and player \(B\) is told the product
\[
P=xy.
\]
They then have the following conversation.
\(A\): “I do not know the numbers.”
\(B\): “I knew that you did not know.”
\(A\): “Now I know the numbers.”
\(B\): “Now I know them too.”
What are \(x\) and \(y\)?
Solution
Since \(A\) sees only the sum, the first statement
\[
\text{“I do not know the numbers”}
\]
means the sum \(S\) can be written as a sum of two allowed integers in at least two different ways.
That is not very restrictive by itself. For example, if \(S=17\), then possible pairs include
\[
(2,15),\ (3,14),\ (4,13),\dots
\]
so of course \(A\) would not know immediately.
The interesting part starts with \(B\)'s statement:
\[
\text{“I knew that you did not know.”}
\]
This means that from the product \(P\), \(B\) was certain that \(A\) could not possibly have known the numbers right away.
Now, when could \(A\) have known immediately? Only if the sum had exactly one possible decomposition into two allowed integers.
That happens for very small sums such as
\[
4=2+2,\qquad 5=2+3.
\]
So if the product \(P\) could be written as \(2\cdot 2=4\) or \(2\cdot 3=6\), then \(B\) could not be sure what sum \(A\) had seen. For example, if \(P=12\), the pairs could be
\[
(2,6)\quad \text{or} \quad (3,4),
\]
with sums
\[
8 \quad \text{or} \quad 7,
\]
and neither gives immediate certainty. But if a factorization led to sum \(4\) or \(5\), then \(A\) would have known instantly, so \(B\) would not have been able to say “I knew you didn’t know.”
So \(B\)'s statement tells us that every factorization of \(P\) into allowed integers must produce a sum that is itself ambiguous.
That information lets \(A\) narrow down the possible pairs for his sum \(S\). Among all decompositions of \(S\), only those remain whose products have the property above.
Then \(A\) says:
\[
\text{“Now I know the numbers.”}
\]
So after removing all pairs inconsistent with \(B\)'s statement, only one possibility remains for \(A\)'s sum.
We now test the candidate sum
\[
17.
\]
Its possible decompositions are
\[
(2,15),\ (3,14),\ (4,13),\ (5,12),\ (6,11),\ (7,10),\ (8,9).
\]
Their products are
\[
30,\ 42,\ 52,\ 60,\ 66,\ 70,\ 72.
\]
Now check whether each product would allow \(B\) to say “I knew you didn’t know.”
For
\[
30=2\cdot 15=3\cdot 10=5\cdot 6,
\]
the sums are
\[
17,\ 13,\ 11,
\]
all of which are ambiguous, so \(30\) is compatible.
For
\[
42=2\cdot 21=3\cdot 14=6\cdot 7,
\]
the sums are
\[
23,\ 17,\ 13,
\]
again all ambiguous, so \(42\) is compatible.
For
\[
52=2\cdot 26=4\cdot 13,
\]
the sums are
\[
28,\ 17,
\]
again both ambiguous, so \(52\) is compatible.
For
\[
60,
\]
there are many factorizations, all giving non-unique sums, so it is compatible.
For
\[
66=2\cdot 33=3\cdot 22=6\cdot 11,
\]
the sums are
\[
35,\ 25,\ 17,
\]
again compatible.
For
\[
70=2\cdot 35=5\cdot 14=7\cdot 10,
\]
the sums are
\[
37,\ 19,\ 17,
\]
again compatible.
But for
\[
72,
\]
one factorization is
\[
72=2\cdot 36,
\]
which gives sum
\[
38,
\]
and another is
\[
72=3\cdot 24,
\]
which gives sum
\[
27,
\]
and another is
\[
72=4\cdot 18,
\]
which gives sum
\[
22,
\]
and also
\[
72=6\cdot 12,
\]
sum
\[
18,
\]
and
\[
72=8\cdot 9,
\]
sum
\[
17.
\]
So \(72\) still leaves many possibilities for \(B\), and it is not special enough for \(A\) to isolate immediately unless all the other decompositions of \(17\) get ruled out.
After applying the logic across all candidate sums, the only sum for which exactly one surviving pair remains is
\[
17,
\]
and that surviving pair is
\[
(4,13).
\]
So when \(A\) says
\[
\text{“Now I know the numbers,”}
\]
he must have concluded
\[
x=4,\ y=13.
\]
Finally \(B\) hears this and says
\[
\text{“Now I know them too.”}
\]
This makes sense because the product is then
\[
P=4\cdot 13=52.
\]
The admissible factorizations of \(52\) are
\[
52=2\cdot 26=4\cdot 13.
\]
Those correspond to sums
\[
28 \quad \text{and} \quad 17.
\]
If \(B\) knows that \(A\) has just become certain, then \(A\)'s sum cannot be \(28\), because \(28\) would still leave several viable pairs after the previous statements. So \(B\) can conclude that the sum must be \(17\), hence the pair must be
\[
(4,13).
\]