6. Klárka had a three-digit number written on a piece of paper. When she correctly multiplied it by nine, she got a four-digit number that started with the same digit as the original number, the middle two digits were the same, and the last digit was the sum of the digits of the original number. What four-digit number could Klárka have gotten?
SOLUTION. Let us look for the original number $x=100a+10b+c$, whose digits are $a, b, c$. Let the digit that appears in the middle two places of the resulting product be denoted by $d$. From the problem statement, we have:

$$
9(100a+10b+c)=1000a+100d+10d+(a+b+c),
$$

where the expression in the last parentheses represents the digit identical to the last digit of the product $9c$. This means that $c$ cannot be $\geq 5$: for such a $c$, the number $9c$ ends with a digit not exceeding 5, and since $a \neq 0$, it follows that $a+b+c > c \geq 5$.

It is also clear that $c \neq 0$ (otherwise, $a=b=c=x=0$ would hold). We will investigate the other possibilities by constructing the following table.

| $c$ | $9c$ | $a+b+c$ | $a+b$ |
| :---: | :---: | :---: | :---: |
| 1 | 9 | 9 | 8 |
| 2 | 18 | 8 | 6 |
| 3 | 27 | 7 | 4 |
| 4 | 36 | 6 | 2 |

Table 1

Equation (1) can be rewritten as

$$
100(b-a-d)=10d+a+11b-8c.
$$

The value of the right-hand side is at least -72 and less than 200, since each of the numbers $a, b, c, d$ is at most nine. Therefore, it is either $b-a-d=0$ or $b-a-d=1$.

In the first case, substituting $d=b-a$ into (2) and rearranging, we get $8c=3(7b-3a)$, from which we see that $c$ is a multiple of three. From Table 1, it follows that $c=3, a=4-b$, which, upon substitution into the equation $8c=3(7b-3a)$, leads to the solution $a=b=2, c=3$. The original number is thus $x=223$ and its ninefold is $9x=2007$.

In the second case, substituting $d=b-a-1$ into (2), we find that $8c+110=3(7b-3a)$. The expression $8c+110$ is therefore divisible by three, so the number $c$ gives a remainder of 2 when divided by three. Substituting the only possible values $c=2$ and $b=6-a$ into the last equation, we find that $a=0$, which contradicts the fact that the number $x=100a+10b+c$ is a three-digit number.

Conclusion: Klárka received the four-digit number 2007.

Note. Table 1 offers a simpler but more numerically laborious method of direct substitution of all permissible values of the numbers $a, b, c$ into equation (1). The number of all possible cases can be reduced to ten by estimating $b \geq a$, which we can determine by a suitable rearrangement of relation (1), for example, into the form (2). We present the solutions in Table 2.

| $a$ | 1 | 2 | 3 | 4 | 1 | 2 | 3 | 1 | $\mathbf{2}$ | 1 |
| ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| $b$ |  |  |  |  |  |  |  |  |  |  |
| $c$ | 6 | 5 | 4 | 5 | 4 | 3 | 3 | $\mathbf{2}$ | 1 |  |
| $9x$ |  |  |  |  |  |  |  |  |  |  |
| 1 | 1 | 1 | 1 | 2 | 2 | 2 | 3 | $\mathbf{3}$ | 4 |  |
| 1539 | 2349 | 3159 | 3969 | 1368 | 2178 | 2988 | 1197 | $\mathbf{2 ~ 0 0 7}$ | 1026 |  |

Table 2

## EXERCISES: