2. Determine how many triples $(a, b, c)$ of natural numbers not exceeding 2018 exist such that the numbers

$$
24^{a}+2^{b}+2018^{c} \quad \text{and} \quad 10^{c}+3^{a}+2018^{b}
$$

are divisible by 3.
2. We have $24^{a}+2^{b}+2018^{c} \equiv 2^{b}+2^{c} \equiv(-1)^{b}+(-1)^{c}(\bmod 3)$ and $10^{c}+3^{a}+2018^{b} \equiv$ $1^{c}+2^{b} \equiv 1+(-1)^{b}(\bmod 3)$. Therefore, the second number is divisible by 3 if and only if $b$ is any odd number. Now, using that $b$ is an odd number, we see that the first number is divisible by 3 if and only if $c$ is an even number. Therefore, the desired condition is satisfied by all triples $(a, b, c)$ where $a$ is any natural number not greater than 2018, $b$ is any odd number not greater than 2018, and $c$ is any even number not greater than 2018. Therefore, there are $2018 \cdot 1009 \cdot 1009=2 \cdot 1009^{3}$ such triples.

![](https://cdn.mathpix.com/cropped/2024_06_04_841f52b4ffb037ad799bg-57.jpg?height=528&width=447&top_left_y=1673&top_left_x=187)