Majka was exploring multi-digit numbers in which odd and even digits alternate regularly. She called those starting with an odd digit "funny" and those starting with an even digit "cheerful." (For example, the number 32387 is funny, and the number 4529 is cheerful.)

Majka created one three-digit funny number and one three-digit cheerful number, using six different digits, none of which were 0. The sum of these two numbers was 1617. The product of these two numbers ended with the two-digit number 40.

Determine Majka's numbers and calculate their product.

(M. Dillingerová)

Hint. How many digits can the products of three-digit numbers have, and how would you calculate them by hand?
The product of two three-digit numbers is at least a five-digit number and at most a six-digit number. For further consideration, let's denote Majčina's numbers and indicate the product calculation:

![](https://cdn.mathpix.com/cropped/2024_04_17_3858df03904f0991bae5g-5.jpg?height=331&width=556&top_left_y=460&top_left_x=750)

Different letters represent different digits, with uppercase letters corresponding to even digits and lowercase letters to odd digits.

For the product to end in 0, \( c \) must be 5 (since 0 is not among the used digits). For the sum to end in 7, \( F \) must be 2.

For the sum to have 1 in the tens place, \( B + e = 11 \). Even \( B \) different from 2 (and 0) and odd \( e \) different from 5, which satisfy this condition, are either \( B = 4, e = 7 \) or \( B = 8, e = 3 \). Let's analyze both possibilities:

- Assume \( B = 4 \) and \( e = 7 \).

\[
\begin{aligned}
& \begin{array}{lll}
a 45 & a 45
\end{array} \\
& \begin{array}{c}
+D 72 \\
1617
\end{array} \begin{array}{c}
\cdot D 72 \\
* 90
\end{array} \\
& * * 15 \\
& \begin{array}{llll}
* & * & * & * \\
* & * & * & *
\end{array}
\end{aligned}
\]

In the product, the last two digits are 40, consistent with the problem statement. For the sum to start with the two-digit number 16, \( a + D = 15 \) (considering the carry from the previous step). Odd \( a \) different from 5 and 7 and even \( D \) different from 2 and 4 (and 0), which satisfy this condition, are only \( a = 9 \) and \( D = 6 \). In this case, the product is 635040.

- Assume \( B = 8 \) and \( e = 3 \).

\[
\begin{aligned}
& a 85 \quad a 85
\end{aligned}
\]

![](https://cdn.mathpix.com/cropped/2024_04_17_3858df03904f0991bae5g-5.jpg?height=109&width=545&top_left_y=1947&top_left_x=801)

\[
\begin{aligned}
& * * 55
\end{aligned}
\]

![](https://cdn.mathpix.com/cropped/2024_04_17_3858df03904f0991bae5g-5.jpg?height=92&width=251&top_left_y=2124&top_left_x=1091)

In this case, the last two digits of the product would be 20, not 40. This possibility thus leads to a contradiction with the requirements of the problem.

In total, the only solution is: Majčina's numbers are 945 and 672, and their product is 635040.

Note. If we had worked with the product written in reverse after the initial derivation of \( c = 5 \) and \( F = 2 \), we would have noticed that regardless of the value of \( e \), the following results:

\[
\begin{aligned}
& D e 2 \\
& \begin{array}{r}
\cdot a B 5 \\
\hline * 60
\end{array} \\
& * * * x
\end{aligned}
\]

![](https://cdn.mathpix.com/cropped/2024_04_17_3858df03904f0991bae5g-6.jpg?height=92&width=251&top_left_y=545&top_left_x=908)

(The digit 6 on the first line of the intermediate result follows from the oddness of \( e \) and the carry over the tens place.) For the last two digits of the product to be 40, \( x \) must be 8, and thus \( B = 4 \). This reasoning reduces the previous trial and error.

#