2014
Problem - 3163
Suppose every term in the sequence
$$1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, \cdots$$
is either $1$ or $2$. If there are exactly $(2k-1)$ twos between the $k^{th}$ one and the $(k+1)^{th}$ one, find the sum of its first $2014$ terms.
Let's divide this sequence into a series of groups. Each group starts with $1$ and is followed by as many $2$s as possible:
$$\{1, 2\}, \quad\{1, 2, 2, 2\}, \quad\{1, 2, 2, 2, 2, 2\},\quad \{1, \cdots$$
It is clear that the $k^{th}$ group contains $2k$ terms whose sum equals $1+(2k-1)\times 2= 4k-1$.
The numbers of terms in these groups form an arithmetic sequence. The total number of terms in first $n$ groups equal $$2\times 1 + 2\times 2 + \cdots + 2\times n = 2\times\frac{n(n+1)}{2}=n\times (n+1)$$
$$n\times (n+1) \le 2014 \implies n = 44$$
This means that $2014$ terms in the original sequence cover $44$ complete group and $1$ partial group. Hence there are $45$ $one$s in the first 2014 terms and $(2014-45)$ $two$'s. Their sum equal
$$45\times 1 + (2014-45)\times 2 = \boxed{3983}$$