# 2008 iTest Problems/Problem 68

## Problem

Let $u_n$ be the $n^\text{th}$ term of the sequence $$1,\,\,\,\,\,\,2,\,\,\,\,\,\,5,\,\,\,\,\,\,6,\,\,\,\,\,\,9,\,\,\,\,\,\,12,\,\,\,\,\,\,13,\,\,\,\,\,\,16,\,\,\,\,\,\,19,\,\,\,\,\,\,22,\,\,\,\,\,\,23,\ldots,$$

where the first term is the smallest positive integer that is $1$ more than a multiple of $3$, the next two terms are the next two smallest positive integers that are each two more than a multiple of $3$, the next three terms are the next three smallest positive integers that are each three more than a multiple of $3$, the next four terms are the next four smallest positive integers that are each four more than a multiple of $3$, and so on: $$\underbrace{1}_{1\text{ term}},\,\,\,\,\,\,\underbrace{2,\,\,\,\,\,\,5}_{2\text{ terms}},\,\,\,\,\,\,\underbrace{6,\,\,\,\,\,\,9,\,\,\,\,\,\,12}_{3\text{ terms}},\,\,\,\,\,\,\underbrace{13,\,\,\,\,\,\,16,\,\,\,\,\,\,19,\,\,\,\,\,\,22}_{4\text{ terms}},\,\,\,\,\,\,\underbrace{23,\ldots}_{5\text{ terms}},\,\,\,\,\,\,\ldots.$$

Determine $u_{2008}$.

## Solution

First, observe that the difference between consecutive terms within a grouping will always equal $3.$ Second, since all terms in a group with $n$ terms are congruent to $n$ modulo $3$ and all terms in a group with $n+1$ terms are congruent to $n+1$ modulo $3,$ the difference between the first term of the group with $n+1$ terms and the last term of the group with $n$ terms is $1.$ This means that the difference between the last terms of a grouping $(1,5,12,22 \cdots)$ have the same second difference, so the series of numbers can be modeled by a quadratic function.

Let $n$ be the number of terms in a group, and let $f(n)$ be the last term in a group with $n$ terms. We can write a system of equations to find a quadratic function. \begin{align*} a+b+c &= 1 \\ 4a+2b+c &= 5 \\ 9a+3b+c &= 12 \end{align*} Solving the system yields $a=\tfrac32, b=-\tfrac12, c=0,$ making the function $f(n) = \tfrac32 x^2 - \tfrac12 x = \tfrac{x(3x-1)}{2}.$

Note that the last term of the group with $n$ terms is term $\tfrac{n(n+1)}{2}$ in the sequence. The largest $n$ such that $\tfrac{n(n+1)}{2} \le 2008$ is $62,$ and $f(62) = \tfrac{62 \cdot 185}{2} = 5735.$ Since $\tfrac{62 \cdot 63}{2} = 1953,$ the $1953^\text{th}$ term of the sequence is $5735.$ This means the $1954^\text{th}$ term is $5736,$ and with some basic algebra (or skip counting), the $2008^\text{th}$ term is $\boxed{5898}.$