8. Given the sequences $\left\{a_{n}\right\}$ and $\left\{b_{n}\right\}$ with the general terms $a_{n}=2^{n}, b_{n}=5 n-2$. Then the sum of all elements in the set
$$
\left\{a_{1}, a_{2}, \cdots, a_{2019}\right\} \cap\left\{b_{1}, b_{2}, \cdots, b_{2019}\right\}
$$

is $\qquad$ .
8.2184 .

Let $\left\{a_{1}, a_{2}, \cdots, a_{n}\right\} \cap\left\{b_{1}, b_{2}, \cdots, b_{n}\right\}$ be the elements arranged in ascending order as the sequence $\left\{c_{n}\right\}$.
Then the problem is reduced to finding the number of solutions to the equation
$$
2^{n}=5 m-2\left(n, m \in \mathbf{Z}_{+}, n, m \leqslant 2019\right)
$$

Clearly, $m$ must be even.
Thus, we need to find the number of solutions to the equation
$$
2^{n}=10 p-2\left(n, p \in \mathbf{Z}_{+}, n \leqslant 2019, p \leqslant 1009\right)
$$

which is equivalent to finding the number of solutions to the equation
$$
2^{n-1}=5 p-1\left(n, p \in \mathbf{Z}_{+}, n \leqslant 2019, p \leqslant 1009\right)
$$

Clearly, $n=3, p=1$ satisfies the requirement.
If $n$ is even, then $4^{\frac{n}{2}}=5 m-2$, but
$$
(5-1)^{\frac{n}{2}} \equiv(-1)^{\frac{n}{2}}(\bmod 5),
$$

which is a contradiction.
Therefore, $n$ must be odd, so we need to find the number of solutions to the equation
$$
4^{q}=5 p-1\left(q, p \in \mathbf{Z}_{+}, q \leqslant 1009, p \leqslant 1009\right)
$$

By $4^{q}=(5-1)^{q} \equiv(-1)^{q}(\bmod 5)$, we know that $q$ must be odd.

Thus, $\left\{c_{n}\right\}$ is a geometric sequence with the first term 8 and common ratio 16.
$$
\text { Hence, }\left\{a_{1}, a_{2}, \cdots, a_{2019}\right\} \cap\left\{b_{1}, b_{2}, \cdots, b_{2019}\right\}
$$

has 3 elements, which are $2^{3}, 2^{7}, 2^{11}$.
Therefore, the sum of the required elements is 2184.