Worded Problem - Difficult to solve

Terry has invented a new way to extend lists of numbers. To *Terryfy* a list such as [1, 8] he creates two lists [2, 9] and [3, 10], where each term is one more than the corresponding term in the previous list, and then joins the three lists together to give [1, 8, 2, 9, 3, 10]. If he starts with a list containing one number [0] and repeatedly *Terryfies* it he creates the list.

[0, 1, 2, 1, 2, 3, 2, 3, 4, 1, 2, 3, 2, 3, 4, 3, 4, 5, 2, 3, 4...].

What is the 2012th number in this *Terryfic* list?

Re: Worded Problem - Difficult to solve

The 2012 number is 1283. Note this could be described by the function, which tells us the number at position x in the sequence, where n = floor[x/3].

Think of this problem like a counter, which grows by size 3^n, the first set {0} = 3^0 = 1

The second set

The third set

....

As soon as the counter resets, At , we me make it bigger , and start counting again from 0 till the counter resets, that is at