Thread: Worded Problem - Difficult to solve

1. 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?

2. 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, $f(x) = x mod 3^n$ 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 ${0, 1, 2} = 3^1$
The third set ${0, 1, 2, 1, 2, 3, 2, 3, 4} = 3^2$
....

As soon as the counter resets, At $3^0 , 3^1, 3^2$, we me make it bigger $3^(n+1)$, and start counting again from 0 till the counter resets, that is at $3^(n+1)$