## Task A-1.2.

A natural number $n$ is the product of four distinct prime numbers $p_{1}, p_{2}, p_{3}, p_{4}$ less than 250. For some three of them, it holds that

$$
p_{1} p_{2} p_{3}=3\left(p_{1}+p_{2}+p_{3}\right)
$$

and the number $p_{1}+p_{2}+p_{3}+p_{4}$ has all digits the same. Determine all such numbers $n$.
## Solution.

First, note that one of the numbers $p_{1}, p_{2}, p_{3}$ is equal to 3. Let $p_{1}=3$.

(1 point) (the order of the factors is not important)

Then we have $p_{2} p_{3}=p_{2}+p_{3}+3$.

This equation can be solved in various ways. Here we will present only two of them.

First method: The obtained equality is equivalent to $\left(p_{2}-1\right)\left(p_{3}-1\right)=4$,

(2 points)

and the only way to represent the number 4 as a product of two different natural numbers is

$4=4 \cdot 1$. Therefore, $p_{2}=2$ and $p_{3}=5$.

(2 points)

Second method: Without loss of generality, we can assume that $p_{2} < p_{3}$. Then $p_{3} > 3$ and we have

$$
p_{2} p_{3}=p_{2}+p_{3}+3 < 3 p_{3} \leqslant p_{2} p_{3}
$$

Contradiction. We conclude that $p_{2}=2$ and it is easy to obtain $p_{3}=5$.

Continuation.

From the condition that the number $p_{1}+p_{2}+p_{3}+p_{4}$ has all digits the same, we conclude that this number is in the set

$$
\{11,22,33,44,55,66,77,88,99,111,222\}
$$

The next possible number would be 333, but since $p_{1}+p_{2}+p_{3}=10$ and $p_{4}<250$, this is not possible.

Since $p_{4}$ is an odd prime number, we can immediately eliminate even numbers from this set, so $p_{4}+10 \in\{11,33,55,77,99,111\}$.

By direct verification, we get $p_{4} \in\{23,67,89,101\}$.

Finally, the desired numbers are

$$
n=p_{1} p_{2} p_{3} p_{4}=2 \cdot 3 \cdot 5 \cdot p_{4}=30 p_{4} \in\{690,2010,2670,3030\}
$$

Note. For solutions written without the procedure and proof that they are the only ones, 1 point should be given for each correct solution and 1 point should be deducted for each incorrect solution.

Note. The first part of the problem (determining the numbers $p_{1}, p_{2}, p_{3}$) can also be solved as follows: Without loss of generality, we can assume $p_{1}<p_{2}<p_{3}$.

Then $3\left(p_{1}+p_{2}+p_{3}\right)<9 p_{3}$, so we have $p_{1} p_{2} p_{3}<9 p_{3}$, or $p_{1} p_{2}<9$.

Since $p_{1}$ and $p_{2}$ are distinct primes, we have only one possibility: $p_{1}=2, p_{2}=3$, and then $p_{3}=5$.