TITLE: Represent every Natural number as a summation/subtraction  of distinct power of 3
QUESTION [5 upvotes]: I have seen this in a riddle where you have to chose 4 weights to calculate any weight from 1 to 40kgs. 
Some examples,
$$8 = {3}^{2} - {3}^{0}$$
$$12 = {3}^{2} + {3}^{1}$$
$$13 = {3}^{2} + {3}^{1}+ {3}^{0}$$
Later I found its also possible to use only 5 weights to calculate any weight between 1-121. 
$$100 = {3}^{4} + {3}^{3} - {3}^{2} + {3}^{0}$$ 
$$121 = {3}^{4} + {3}^{3} + {3}^{2} + {3}^{1} + {3}^{0}$$      
Note: It allows negative numbers too. how I represent 8 and 100. 
I want to know if any natural number can be represented as a summation of power of 3. I know this is true for 2. But is it really true for 3? What about the other numbers? Say $4, 5, 6, ... $

REPLY [4 votes]: As requested, I write up an answer along the lines of my comments, although it is much the same as Daniel's answer: Given any positive integer $n,$ subtract the highest possible power of $3$ from $n$ which leaves a non-negative remainder, then repeat until zero is eventually reached.This expresses $n$ as a sum of powers of $3$ in which no power is repeated more than twice (the standard ternary representation of $n$). Then (starting from the left) replace $2.3^{k}$ by $3^{k+1} - 3^k$ whenever $3^k$ appears twice (this may disturb the coefficient of $3^{k+1},$ which would have previously been been $0,1$ or $-1$ since we started from the left. If it was previously $1$ then we have to adjust accordingly, moving left again). At the end, we will have written $n$ as a "sum" of powers of $3$ in which every power of $3$ which actually appears appears with coefficient $\pm 1.$
An illustrative example is $41 = 27 + 9 + 3 + 1+ 1.$ This can be rewritten as 
$27 +9 + 3 + (3-1) = 27 + 9 + (9-3) - 1 = 27 + 27 -9 -3 -1$ = $81 - 27 -9 -3-1.$