4. Determine, if they exist, all four-digit natural numbers that are divisible by the number written with the same digits in reverse order, and in this division, the quotient is:

a) three,

b) four.

(It is possible that the number written with the same digits in reverse order starts with zero or zeros, so for example, from the number 3210, the number 0123, i.e., 123, would be obtained.)
## Solution.

Let $\overline{a b c d}$ be a four-digit number, so $a, b, c, d \in\{0,1,2, \ldots, 9\}, a \neq 0$.

Then $\overline{d c b a}$ is the number written with the same digits in reverse order.

a) If $\overline{a b c d}: \overline{d c b a}=3$, then $\overline{d c b a} \cdot 3=\overline{a b c d}$.

Consider all possibilities for the digit $a$:

| $a$ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $3 a$ | 3 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 |
| $d$ | 3 | $\mathbf{6}$ | $\mathbf{9}$ | 2 | $\mathbf{5}$ | $\mathbf{8}$ | 1 | $\mathbf{4}$ | $\mathbf{7}$ |
|  |  | $\boldsymbol{d}>\mathbf{3}$ | $\boldsymbol{d}>\mathbf{3}$ |  | $\boldsymbol{d}>\mathbf{3}$ | $\boldsymbol{d}>\mathbf{3}$ |  | $\boldsymbol{d}>\mathbf{3}$ | $\boldsymbol{d}>\mathbf{3}$ |
| $3 d$ | $\mathbf{9}$ |  |  | $\mathbf{6}$ |  |  | 3 |  |  |
|  | $\mathbf{3} \boldsymbol{d}>\boldsymbol{a}$ |  |  | $\mathbf{3 d}>\boldsymbol{a}$ |  |  |  |  |  |
|  |  |  |  |  |  |  | $\boldsymbol{? ?}$ |  |  |

The number $\overline{d c b a}$ cannot be greater than 3333 because $3334 \cdot 3$ is a five-digit number. Therefore, $d \leq 3$, so the possibilities $a \in\{2,3,5,6,8,9\}$ are eliminated.

Considering the thousands digits, we conclude that $d \cdot 3 \leq a$, so $a=1$ and $a=4$ are also eliminated. In the remaining case, $a=7, d=1$, the number $\overline{a b c d}=\overline{7 b c 1}$ is greater than 7000, while the number $\overline{d c b a}=\overline{1 c b 7}$ is less than 2000, so the product $\overline{d c b a} \cdot 3$ is less than 6000. Therefore, there is no solution in this case either.

Thus, there is no four-digit number that is divisible by the number written with the same digits in reverse order and the quotient is 3.
b) If $\overline{a b c d}: \overline{d c b a}=4$, then $\overline{d c b a} \cdot 4=\overline{a b c d}$.

Consider all possibilities for the digit $a$:

| $a$ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $4 a$ | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 |
| $d$ | $\mathbf{4}$ | $\mathbf{8}$ | 2 | $\mathbf{6}$ | 0 | $\mathbf{4}$ | $\mathbf{8}$ | 2 | $\mathbf{6}$ |
|  | $\boldsymbol{d}>\mathbf{2}$ | $\boldsymbol{d}>\mathbf{2}$ |  | $\boldsymbol{d}>\mathbf{2}$ |  | $\boldsymbol{d}>\mathbf{2}$ | $\boldsymbol{d}>\mathbf{2}$ |  | $\boldsymbol{d}>\mathbf{2}$ |
| $4 d$ |  |  | $\mathbf{8}$ |  | 0 |  |  | 8 |  |
|  |  |  | $\mathbf{4 d}>\boldsymbol{a}$ |  |  |  |  |  |  |
|  |  |  |  |  | $? ?$ |  |  | $? ?$ |  |

The number $\overline{d c b a}$ cannot be greater than 2499 because $2500 \cdot 4$ is a five-digit number. Therefore, $d \leq 2$, so the possibilities $a \in\{1,2,4,6,7,9\}$ are eliminated.

Considering the thousands digits, we conclude that $d \cdot 4 \leq a$, so $a=3$ is also eliminated.

Two possibilities remain.

If $a=5, d=0$, the number $\overline{a b c d}=\overline{5 b c 0}$ is greater than 5000, while the number $\overline{d c b a}=\overline{0 c b 5}=\overline{c b 5}$ is less than 1000, so the product $\overline{d c b a} \cdot 4$ is less than 4000. Therefore, there is no solution in this case.

If $a=8, d=2$, the product is $\overline{2 c b 8} \cdot 4=\overline{8 b c 2}$.

This can also be written as:

$$
(2000+100 c+10 b+8) \cdot 4=8000+100 b+10 c+2
$$

Rearranging, we get:

$$
\begin{gathered}
8000+400 c+40 b+32=8000+100 b+10 c+2 \\
390 c+30=60 b \\
13 c+1=2 b
\end{gathered}
$$

Since $b$ cannot be greater than 9, the value of the expression $13 c+1$ must be an even number not greater than 18, so $c$ can only be 0 or 1. If $c=0$, then $13 c+1$ is not an even number.

If $c=1$, then $2 b=13 c+1=14$, so $b=7$.

We have the number 8712. Verify: $2178 \cdot 4=8712$.

The number 8712 is the only four-digit number that is divisible by the number written with the same digits in reverse order and the quotient is 4.

The case $a=8, d=2$ can also be solved by examining all possibilities for $b \in\{0,1,2,3,4,5,6,7,8,9\}$.