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