4. A natural number $n$ when divided by 3 gives a remainder $a$, when divided by 6 gives a remainder $b$, and when divided by 9 gives a remainder $c$. It is known that $a+b+c=15$. Determine the remainder when the number $n$ is divided by 18.
Solution. From the condition of the problem, it follows that the number $n$ can be written in the forms $n=3 p+a, n=6 q+b$ and $n=9 r+c$, where since $a, b, c$ are remainders when $n$ is divided by $3,6,9$, respectively, it holds that $0 \leq a \leq 2, \quad 0 \leq b \leq 5,0 \leq c \leq 8$, so $0 \leq a+b+c \leq 15$. Furthermore, since $a+b+c=15$, we get that $a=2, b=5$ and $c=8$. Now, $n+1=3 p+3=6 q+6=9 r+9$. According to this, the number $n+1$ is divisible by $3,6,9$, so $n+1$ is divisible by $\operatorname{LCM}(3,6,9)=18$. Finally, the number $n$ when divided by 18 gives a remainder of 17.