The two numbers are:
$X=21, Y=42.$
Sarah gets a sheet of paper saying $S=63$. In her view, as $X$ divides $Y$ there are only four possible pairs: (7, 56), (3, 60), (21, 42) and (9, 54). Donna gets a sheet of paper saying $D=21$. In her view, there are three possible pairs: (3, 24), (7, 28) and (21, 42).
Sarah says that Richard doesn’t know the numbers, since for no possible ratio in her view (8, 20, 2 or 6) there is only one possible pair. Donna agrees, since for no possible ratio in her view (8, 4 or 2) there is only one possible pair.
Once Richard gives his ‘false’ statement, Sarah and Donna only consider pairs that have a ratio for which Richard can be sure that they both know that he doesn’t know the numbers. Technically speaking, they only leave ratios for which (brace yourself), for every sum/difference that can come from a pair with this ratio, and for every possible ratio that can come from a pair with this sum/difference, there are more than one possible pairs leading to this ratio. In practice, Sarah drops the ratios 2 and 6 and Donna drops the ratio 2.
Now Sarah considers the pairs (3, 60) and (7, 56) and Donna considers the pairs (3, 24) and (7, 28). Note that they both dropped the correct pair, and this leads to the confusion:
Donna is left with two possible pairs, so she says she doesn’t know the numbers. She also figures that the possible sums are 3+24=27 and 7+28=35. For both sums there have been two optional pairs to begin with, but the information from Richard reduced it to one (and Donna knows it). So she says that Sarah must know the numbers. Sarah, however, is also left with two possible pairs and is confused to hear that.
So far so good. The big question is - how did Richard figure out the numbers?
There are 382 pairs of $2 \le X \le Y \le 100$ with a natural $R$, making 134, 88 and 50 possible sums, differences and ratios. Richard (and us) can keep in mind (or on a piece of paper…) the possible views of Sarah and Donna, given their sheets of paper. For every sum/difference we can list the different pairs, and update these with every piece of information. Every time Sarah/Donna makes a statement, she gives the others (and us) information about the possible sums/differences. This information is in the form of ‘which sums/differences I cannot possibly hold in my hand’. This way every statement eliminates a group of $X$-$Y$ pairs. Richard’s statement does the same (with possible ratios) but of course it’s false information. At every stage we have to have a complete picture of the possible sums, differences and ratios in the girls view, and the possible pairs related to them. Let’s go through the statements and see how we can eliminate most pairs.
First statement - Sarah knows that Richard doesn’t know the numbers.
This means that, for the particular sum Sarah holds, no possible ratio has only one optional pair (otherwise Richard could have known it). Therefore, in Donna’s and Richard’s view, every sum that doesn’t meet this criteria is eliminated. These sums are 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100 and 102. This of course eliminates all pairs with this sum.
Second statement - Donna knows that Richard doesn’t know the numbers.
Same thing - in Sarah’s and Richard’s view, every difference that doesn’t meet this criteria is eliminated. These differences are 44, 52, 56, 60, 64, 68, 70, 74, 82, 86, 92, 94 and 98. This eliminates further pairs.
Third statement (1) - Sarah and Donna don’t know the numbers.
Here we simply eliminate all sums and differences that only have one optional pair. The eliminated sums are 4, 9, 25, 49, 93, 106, 111, 115, 117, 118, 122, 123, 125, 128, 129, 130, 134, 135, 136, 140, 141, 142, 146, 147, 148, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198 and 200. The eliminated differences are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 76, 78, 85, 87, 91, 93, 95 and 96. Since Richard realises these two things together, the two updates happen simultaneously. Namely, Donna doesn’t use Sarah’s statement (that she doesn’t know the numbers) before stating it herself, and vice versa.
Third statement (2) - Richard knows that both Sarah and Donna know that he doesn’t know the numbers.
This is of course misleading for Sarah and Donna, but we have to keep track of what it makes them think. Richard’s view doesn’t change from this point on. In Sarah’s and Donna’s view (as we said above) Richard can be sure that Sarah and Donna were sure that he doesn’t know the numbers. This eliminates the sums 6, 8, 12, 14, 16, 21, 22, 24, 28, 33, 44, 52, 56, 62, 64, 66, 68, 77, 112, 114, 116, 124, 126, 132, 138, 144 and 150 and the differences 0, 4, 8, 10, 15, 16, 20, 25, 32, 40, 48, 58, 62, 80 and 90. The key here, as we said, is that Richard’s ‘false’ statement makes Sarah and Donna eliminate the correct pair but not all possible pairs for their sum/difference. This is how they get to a contradiction.
Fourth statement - Donna doesn’t know the numbers and thinks that Sarah does.
For Richard (and us) this eliminates differences with only one pair, and ones that are related to sums with more than one pair. They are 6, 9, 12, 14, 18, 22, 24, 26, 27, 30, 34, 35, 36, 38, 39, 42, 45, 46, 49, 50, 51, 54, 55, 57, 63, 65, 66, 69, 72, 75, 81, 84 and 88.
Fifth statement - Sarah doesn’t know the numbers.
For Richard (and us) this eliminates sums with only one pair - 10, 15, 18, 20, 26, 27, 32, 34, 35, 36, 38, 39, 42, 46, 48, 51, 55, 57, 58, 69, 87, 91, 95, 99, 104, 105, 108, 110 and 120.
After all this, Richard knows that Sarah has one of 11 possible sums - 30, 40, 45, 50, 54, 60, 63, 65, 75, 81 or 85 - and Donna one of 4 possible differences - 21, 28, 33 or 77. As we said above, they both eliminated the correct pair, but all that left for Richard (and us) to do is to check which of the possible pairs from before his statement leads to one of these sums and one of these differences. And this is nothing but the pair:
$X=21, Y=42.$