In a store, we paid with 1000 forints. On the receipt, the amount to be paid and the change consisted of the same digits, just in a different order. What is the sum of the digits?
I. solution. The amount to be paid and the amount returned are both three-digit (not necessarily distinct digit) whole numbers. Let $\overline{a b c}$ represent the amount to be paid. The digits $a, b, c$ appear in the returned amount in some order different from the previous one. These can be:

$$
a, c, b ; \quad b, a, c ; \quad b, c, a ; \quad c, a, b ; \quad \text { and } \quad c, b, a \text {. }
$$

Let's examine these cases one by one.

1. $\begin{array}{r}a b c \\ +\quad a c b \\ \hline 1000\end{array}$

In this case, either $b+c=0$ which means $b=c=0$ and then $a=5$, but here the order of the digits is not different; or $b+c=10$, but then due to the carry-over, the sum $b+c+1$ cannot end in $0$. This is therefore not possible.
2. $\begin{array}{r}a b c \\ +\quad b a c \\ \hline 1000\end{array}$

From this, either $c=0$, which is not possible because then $b+a=10$ and $a+b+1=10$; or $c=5$ and $b+a+1=10$ so $b+a=9$, and the sum of the digits is $9+5=14$.

$$
a b c
$$

![](https://cdn.mathpix.com/cropped/2024_05_02_63422fa2a822b9809724g-1.jpg?height=90&width=261&top_left_y=860&top_left_x=214)

From here, $c+a=10, c+b+1=10$, so $a-b=1$, and $a+b+1=10$ so $a+b=9$. From the system of equations, $a=5, c=5, b=4$, and the sum of the digits is 14.

$a b c$

![](https://cdn.mathpix.com/cropped/2024_05_02_63422fa2a822b9809724g-1.jpg?height=84&width=260&top_left_y=1064&top_left_x=214)

Similarly to the previous cases, $b+c=10, a+b=9$, and $a+c=9$, so $a=4, b=5$ and $c=5$, and the sum of the digits is 14. $a b c$

![](https://cdn.mathpix.com/cropped/2024_05_02_63422fa2a822b9809724g-1.jpg?height=90&width=261&top_left_y=1229&top_left_x=214)

Finally, $a$ and $c$ cannot both be 0 at the same time, because then we would not get a three-digit number. If, however, $a+c=10$, then $2 b+1=10$ is not possible.

We can see that if there is a solution, for example 365 and 635, then the sum of the digits is 14.

II. solution. Let the purchase amount be $A$, and the sum of the digits of $A$ be $S(A)$. According to the condition, $A$ and $1000-A$ consist of the same digits. First, we show that the last digit of $A$ cannot be 0. If this were the case, then for the two-digit number $\overline{x y}=10 x+y$ formed by the first two digits of $A$, $100-\overline{x y}$ would also consist of the same digits, but in reverse order. This, however, is not possible, since $10 x+y+10 y+x=11(x+y)$ and this 11-divisible sum cannot be equal to 100.

If the last digit of $A$ is not 0, then $S(1000-A)=1+S(999-A)$. Since the subtraction $999-A$ can be performed without carrying over, $S(999-A)=3 \cdot 9-S(A)=27-S(A)$, so $S(1000-A)=1+27-S(A)$. Since the digits of $A$ and $1000-A$ are the same, $S(A)=S(1000-A)=28-S(A)$, so $S(A)=14$.

The sum of the digits of the three-digit numbers described in the problem is therefore 14. Such a number exists, for example, 365.

Remark. It is not true that if $S(A)=14$, then $A$ is a three-digit number that meets the conditions of the problem, for example, in the case of $A=536$, $1000-A$ differs from each of the numbers obtained by rearranging the digits of $A$.