Consider the lengths of consecutive 1-2 blocks.
block 1 - 1, 2 - length 2
block 2 - 1, 2, 2 - length 3
block 3 - 1, 2, 2, 2 - length 4
block 4 - 1, 2, 2, 2, 2 - length 5
and so on.
Recall the formula for the sum of consecutive positive integers,
![\displaystyle \sum_{i=1}^j i = 1 + 2 + 3 + \cdots + j = \frac{j(j+1)}2 \implies \sum_{i=2}^j = \frac{j(j+1) - 2}2](https://tex.z-dn.net/?f=%5Cdisplaystyle%20%5Csum_%7Bi%3D1%7D%5Ej%20i%20%3D%201%20%2B%202%20%2B%203%20%2B%20%5Ccdots%20%2B%20j%20%3D%20%5Cfrac%7Bj%28j%2B1%29%7D2%20%5Cimplies%20%5Csum_%7Bi%3D2%7D%5Ej%20%3D%20%5Cfrac%7Bj%28j%2B1%29%20-%202%7D2)
Now,
![1234 = \dfrac{j(j+1)-2}2 \implies 2470 = j(j+1) \implies j\approx49.2016](https://tex.z-dn.net/?f=1234%20%3D%20%5Cdfrac%7Bj%28j%2B1%29-2%7D2%20%5Cimplies%202470%20%3D%20j%28j%2B1%29%20%5Cimplies%20j%5Capprox49.2016)
which means that the 1234th term in the sequence occurs somewhere about 1/5 of the way through the 49th 1-2 block.
In the first 48 blocks, the sequence contains 48 copies of 1 and 1 + 2 + 3 + ... + 47 copies of 2, hence they make up a total of
![\displaystyle \sum_{i=1}^48 1 + \sum_{i=1}^{48} i = 48+\frac{48(48+1)}2 = 1224](https://tex.z-dn.net/?f=%5Cdisplaystyle%20%5Csum_%7Bi%3D1%7D%5E48%201%20%2B%20%5Csum_%7Bi%3D1%7D%5E%7B48%7D%20i%20%3D%2048%2B%5Cfrac%7B48%2848%2B1%29%7D2%20%3D%201224)
numbers, and their sum is
![\displaystyle \sum_{i=1}^{48} 1 + \sum_{i=1}^{48} 2i = 48 + 48(48+1) = 48\times50 = 2400](https://tex.z-dn.net/?f=%5Cdisplaystyle%20%5Csum_%7Bi%3D1%7D%5E%7B48%7D%201%20%2B%20%5Csum_%7Bi%3D1%7D%5E%7B48%7D%202i%20%3D%2048%20%2B%2048%2848%2B1%29%20%3D%2048%5Ctimes50%20%3D%202400)
This leaves us with the contribution of the first 10 terms in the 49th block, which consist of one 1 and nine 2s with a sum of
.
So, the sum of the first 1234 terms in the sequence is 2419.