Richard was playing with two five-digit numbers. Each consisted of different digits, all of which were odd in one number and all even in the other. After a while, he found that the sum of these two numbers started with the double-digit 11 and ended with the digit 1, and that their difference started with the digit 2 and ended with the double-digit 11.

Determine Richard's numbers.

(M. Dillingerová)

Hint. How many digits can the sums and differences of five-digit numbers have, and how would you calculate them by hand?
The sum of two five-digit numbers can be a five-digit or a six-digit number. However, five-digit sums cannot start with the digit 1, meaning the sum is a six-digit number. The difference of two five-digit numbers can be at most a five-digit number. For easier expression, let's denote Richard's numbers as:

$$
\begin{array}{rl} 
& A B C D E \\
+a b c d e \\
\hline 1 & 1 * * * 1
\end{array} \quad \begin{array}{r}
A B C D E \\
-a b c d e \\
\hline * * * 11
\end{array}
$$

Different letters represent different digits, with uppercase letters corresponding to even digits and lowercase letters to odd digits, or vice versa. Since there are 10 digits, all will be used in Richard's numbers.

For the sum to start with the two-digit number 11, \(A + a\) must be either 11 or 10 (with a carry-over from the tens place). However, the sum of an even and an odd number is an odd number, so \(A + a\) must be 11.

If the difference were at most a four-digit number, then \(A - a\) would have to be at most 1. However, the difference between an even and an odd number is an odd number, so \(A - a\) must be 1. From this and the previous \(A + a = 11\), we get

$$
A = 6, \quad a = 5
$$

If the difference were a five-digit number starting with 2, then \(A - a\) would have to be either 2 or 3 (with a carry-over from the tens place). However, the difference between an even and an odd number is an odd number, so \(A - a\) must be 3. From this and the previous \(A + a = 11\), we get

$$
A = 7, \quad a = 4
$$

For the sum to end with the digit 1, \(E + e\) must be either 1 or 11. For the difference to end with the digit 1, \(E - e\) must be either 1 or \(E = 0\) and \(e = 9\). The previous two conditions are simultaneously satisfied for

$$
E = 6, \quad e = 5
$$

or for

$$
E = 1, \quad e = 0
$$

The previous discussion gives four possible assignments for the first and last digits of Richard's numbers. To meet the basic requirements (i.e., no digit is repeated and one number is composed of odd digits while the other is composed of even digits), we must have \(A = 7\), \(a = 4\), \(E = 1\), and \(e = 0\):

![](https://cdn.mathpix.com/cropped/2024_04_17_6aef7ef60e9f55f815aeg-3.jpg?height=170&width=615&top_left_y=1057&top_left_x=735)

For the second digit in the sum to be 1, \(B + b < 10\), and for the difference to start with 2, \(B < b\). Among the remaining digits, the only pair that satisfies these conditions is \(B = 3\) and \(b = 6\). For the second-to-last digit in the difference to be 1, \(D - d = 1\). Among the remaining digits, the only pair that satisfies this condition is \(D = 9\) and \(d = 8\). The remaining two digits are \(C = 5\) and \(c = 2\).

Richard's numbers are 73591 and 46280, and the previous calculations are as follows:

$$
\begin{array}{r}
73591 \\
+46280 \\
\hline 119871
\end{array} \quad \begin{array}{r}
73591 \\
-46280 \\
\hline 27311
\end{array}
$$