4. A sequence of 2019 numbers $a_{1}, a_{2}, a_{3}, \ldots, a_{2019}$ is given. It is known that for any 4 consecutive terms of the sequence, their sum is constant. Similarly, for any two consecutive numbers, their absolute difference is constant (i.e., $\left|a_{1}-a_{2}\right|=\left|a_{2}-a_{3}\right|=\left|a_{3}-a_{4}\right|=\ldots$ ).

It is also known that $a_{1}<a_{2}<a_{3}$ and that $a_{2}=6$. What is the sum of all the numbers in the sequence?
(A) 2019
(B) 2020
(C) 4038
(D) 12114
(E) The data is insufficient to determine it
4. The answer is (D). Since the sum of 4 consecutive terms is constant, for every $n \geq 1$ we have $a_{n}+a_{n+1}+a_{n+2}+a_{n+3}=a_{n+1}+a_{n+2}+a_{n+3}+a_{n+4}$, from which $a_{n}=a_{n+4}$, meaning the sequence is periodic and repeats every 4 terms. Since $a_{1}<a_{2}<a_{3}$, the differences $a_{2}-a_{1}$ and $a_{3}-a_{2}$ are positive and, by assumption, equal to a constant $d$. Since $a_{2}=6$, we can write $a_{1}=6-d$, $a_{3}=6+d$ and obtain $a_{5}=a_{1}=6-d$ due to periodicity; $a_{4}-a_{3}= \pm d$, so $a_{4}=6+2 d$ or $a_{4}=6$. In the first case, we would have $a_{4}-a_{5}=3 d$, which is absurd, so necessarily $a_{4}=6$. The sequence is thus $6-d, 6,6+d, 6,6-d, 6 \ldots 6-d, 6,6+d$ (since the terms are 2019, which gives a remainder of 3 when divided by 4). In each block of 4 and in the last block of 3, the elements $6-d$ and $6+d$ sum to $12=6 \cdot 2$ and thus the total sum is $2019 \cdot 6=12114$ regardless of $d$.