We are given $(3^n-1)/2$ coins, and among those coins there is just one counterfeit coin. All the other coins weigh the same, but the counterfeit coin weighs slightly heavier or lighter (we don't know which is the case) than a normal coin.
Using a balance scale only, is it possible to identify the counterfeit coin, weighing not more than $n$ times?
My attempt : Using $-1, 0, +1$ instead of $0, 1, 2$, we may write each integer from $-(3^n-1)/2$ to $(3^n-1)/2$ in base 3, with digits among $-1, 0, +1$, in a unique manner. Label the coins from $1$ to $(3^n-1)/2$, and for each coin, labelled $k$, say, we designate one number in $\left\{-k,+k\right\}$ as being 'heavy' and the other one as being 'light'.
My claim is that it is possible to do this so that the resulting designation satisfies the following property :
For each $0\leq i\leq n-1$, the number of heavy numbers whose $3^i$-digit is -1 equals the number of heavy numbers whose $3^i$-digit is +1.
If this is the case, than the following weighing strategy works : On $i$th weighing, put all the coins whose 'heavy' representation has $-1$ on its $3^i$-digit on the left. Put all the coins whose 'heavy' representation has $+1$ on its $3^i$-digit on the right.
Assuming the counterfeit coin is heavy, our $i$th weighing shows us the $3^i$-digit of the coin. After $n$ weighings, we may deduce which coin is counterfeit.
If the counterfeit coin is light, a similar reasoning also works, and it is clear from our construction the final answer does not depend on whether the counterfeit coin is heavier or lighter than a normal coin.
I believe that this strategy makes sense, but I was not capable proving that such a designation is possible (see the quote box). Am I on the right track? Is such a dsignation possible? Are there any more beautiful solutions to this innocent-looking puzzle?