3. The sum of the digits of the number $X$ is $Y$, and the sum of the digits of the number $Y$ is $Z$. If $X+Y+Z=60$, determine the number $X$.


Solution. It is easily verified that the number $X$ must be a two-digit number (if it is a one-digit number, then the sum $X+Y+Z$ will be less than 60, and if it is a three-digit number, this sum will be greater than 60). Let $X=10a+b$, where $a$ and $b$ are digits. Then $Y=a+b$ and

$$
Z= \begin{cases}a+b, & a+b \leq 9 \\ a+b-9, & a+b>9\end{cases}
$$

In the first case, $60=X+Y+Z=12a+3b$, i.e., $4a+b=20$, from which we get $(a, b) \in\{(4,4),(5,0),(3,8)\}$. The last of these possibilities is eliminated, because in that case $a+b=3+8>9$. In the second case, we get $60=X+Y+Z=12a+3b-9$, i.e., $4a+b=23$, from which we find $(a, b) \in\{(4,7),(5,3)\}$, but the last pair is also eliminated because in that case $a+b=5+3<9$. Therefore, the required numbers are 44, 50, and 47.