3. Find all real numbers $a$ such that for every infinite sequence of pairwise distinct positive integers $a_{1}, a_{2}, \cdots, a_{n}, \cdots$, if $a_{n} \leqslant a n$ for each positive integer $n$, then the sequence has infinitely many terms whose sum of digits in base 4038 is not divisible by 2019.
3. Since $a_{1}$ is a positive integer not greater than $a$, we have $a \geqslant 1$.
Let $\sigma\left(a_{n}\right)$ denote the remainder when the sum of the digits of $a_{n}$ in base 4038 is divided by 2019.

Consider the sequence of non-negative integers $\left\{b_{n} \mid \sigma\left(b_{n}\right)=0\right\}$ $(n \geqslant 0)$, where $b_{0}=0, b_{1}=2019, \cdots \cdots$
For any positive integer $n$, since
$$
2019 n, 2019 n+1, \cdots, 2019 n+2018
$$

have only the last digit different in base 4038, we know that
$$
\sigma(2019 n), \sigma(2019 n+1), \cdots, 
$$
$\sigma(2019 n+2018)$
form a complete residue system modulo 2019.
Thus, $2019 n \leqslant b_{n} \leqslant 2019 n+2018$.
Consider the sequence $a_{1}, a_{2}, \cdots$ that does not satisfy the condition, i.e., only a finite number of terms $a_{i_{1}}, a_{i_{2}}, \cdots, a_{i_{i}}$ satisfy $\sigma\left(a_{i_{j}}\right) \neq 0(j=1$, $2, \cdots, t)$, then there exists a positive integer $M$, such that when the positive integer $m \geqslant M$, $a_{m} \in\left\{b_{n}\right\}(n \geqslant 0)$, i.e., for each positive integer $N$ we have $a_{M+k} \in\left\{b_{n}\right\}(k=0,1, \cdots, N)$.
Assume $a<2019$.
Since the terms in the sequence are distinct, then
$$
2019 N \leqslant b_{N} \leqslant \max _{0 \leqslant k \leqslant N}\left\{a_{M+k}\right\} \leqslant a(M+N) \text {. }
$$

Thus, $N \leqslant \frac{a M}{2019-a}$ holds for all positive integers $N$, which is a contradiction (since $M$ and $a$ are fixed).

Therefore, for each real number $a(1 \leqslant a<2019)$, there exists an infinite sequence that satisfies the condition.
For $a \geqslant 2019$, the sequence $1, b_{1}, b_{2}, \cdots$ satisfies:
$$
\begin{array}{l}
a_{n}=b_{n-1} \leqslant 2019 n \leqslant a n, \\
\sigma\left(a_{n}\right)=0(n \geqslant 1) .
\end{array}
$$

Thus, only the first term in the sequence does not have the sum of its digits in base 4038 divisible by 2019.
Hence, $a \geqslant 2019$ does not satisfy the condition.
Therefore, $1 \leqslant a<2019$.