5. The sequence $1,2,1,2,2,1,2,2,2,1,2,2,2,2,1,2, \cdots$ has 2s separating each pair of 1s, with the $n$-th pair of 1s separated by $n$ 2s. What is the sum of the first 1234 terms of the sequence?
A. 1996
B. 2419
C. 2429
D. 2439
5. B Solution 1 Let the number of 1s in the first 1234 terms of the sequence be $k$. Thus, we have $1234 \leqslant k+(1+2+3+\cdots+k)=k+\frac{k(k+1)}{2}$, which simplifies to $k^{2}+3 k-2468 \geqslant 0$, yielding $k=49$. Therefore, $S_{1234}=49+2(1234-49)=2419$.
Hence, the answer is B.
Solution 2 Construct the complementary sequence $1,0,1,0,0,1,0,0,0,1,0,0,0,0,1,0, \cdots$ and add it term by term to the given sequence, resulting in $2,2,2,2, \cdots$
The number of 1s in the first 1234 terms of the complementary sequence (calculated in the same way as in Solution 1) is $k=49$,
and $S_{1234}=1234 \times 2-49=2419$.
Hence, the answer is B.