4. Find the smallest integer solution of the equation

$$
\left\lfloor\frac{x}{8}\right\rfloor-\left\lfloor\frac{x}{40}\right\rfloor+\left\lfloor\frac{x}{240}\right\rfloor=210
$$

(If $x$ is a real number, $\lfloor x\rfloor$ is the integer part of $x$, that is, the greatest integer less than or equal to $x$.)
Solution. Let $x$ be an integer solution of the equation. Dividing first by 240, then the remainder $r_{1}$ by 40, and the new remainder $r_{2}$ by 8, we get

$$
x=240 c_{1}+r_{1}=240 c_{1}+40 c_{2}+r_{2}=240 c_{1}+40 c_{2}+8 c_{3}+r_{3}
$$

where $0 \leq c_{2}<6, 0 \leq c_{3}<5$ and $0 \leq r_{3}<8$ (the inequalities for $c_{2}$ and $c_{3}$ are obtained from $0 \leq r_{1}<240$ and $0 \leq r_{2}<40$). Then

$210=\left\lfloor\frac{x}{8}\right\rfloor-\left\lfloor\frac{x}{40}\right\rfloor+\left\lfloor\frac{x}{240}\right\rfloor=\left(30 c_{1}+5 c_{2}+c_{3}\right)-\left(6 c_{1}+c_{2}\right)+c_{1}=25 c_{1}+4 c_{2}+c_{3}$, and the only possible case is $c_{1}=8, c_{2}=2, c_{3}=2$ (reducing modulo 5 leaves $c_{2} \equiv c_{3}(\bmod 5)$ and necessarily $c_{2}=c_{3}$; then $42=5 c_{1}+c_{2}$ and it must be $\left.c_{2}=2, c_{1}=8\right)$, so

$$
x=240 \times 8+40 \times 2+8 \times 2+r_{3}=2016+r_{3}
$$

and the smallest integer solution of the given equation is $x=2016$ (the others are $2017, \ldots, 2023$).