This uses much less math than other options, especially for most numbers that aren't designed to thwart it. (which I'm calling $tricky$ numbers)
If the numbers aren't $tricky$.
Concatenate the observed numbers. With no separators or encoding. Two of the three numbers you can observer and for most numbers it will be unambiguous what numbers are left over.
If the numbers are $tricky$:
Concatenate the observed numbers, then concatenate the numbers again but add 1 to eachchange the first digit of each number being concatenated (modifying the last digit also works).
- $tricky$ number description:
Even if the numbers chosen to becomewere ambiguous when concatenated and one is replaced: seeing 111, 1111such as repeating sequences or numbers of different length, 11111 and receiving n 1'syou would write them in a given order: (111...111). Your number could be n-7$ABC$, n-8then again, or n-9 1's.
Examples of use:
Non-tricky:
You see 12, 34, 56. And your number is 123 you write:
123456. Ifmodifying the person with 56 reads this they can see 12, 34, and 123first digit of each: $ABCabc$. The only way to arrange the numbers is to use the
Example:
You see 12 121212 and 34, leaving 56 unaccounted for, so it must be his number12121212.
Tricky example:
you see 12 121212 and 12121212. your number is 1212. you write:
12121212121212121312121312121213 You write: 12121212121212124242121242121212. Whoever reads it divides it in half (this example doesn't require carrying, but if it did that fact would be obvious) 1212121212121212 and 13121213121212134242121242121212 and sees where the 1's4's were added to correctly parse the first part: 12 121212 12121212, they see two of these numbers and know they are the third.
Another example: if you saw the numbers 3, 33 and 333, you would write down:
333333553533
Or something similar. Once splitting, the first half gives you the raw answer concatenated:
333333
Whereas the second half gives you the places to split it, based on where differences happen:
5 - 53 - 533
This way, you can always tell the three numbers apart. Once receiving someone else's number, you can easily work out your number by excluding the numbers you can already see.