Consider the sequences recursively defined by the function:
f(n)=(3^n+1)/2
such that:
s(0)=f(0)=1
s(1)=s(0)f(1)s(0)=1,2,1
s(2)=s(1)f(2)s(1)=1,2,1,5,1,2,1
s(3)=s(2)f(3)s(2)=1,2,1,5,1,2,1,14,1,2,1,5,1,2,1
........
Now I need to demonstrate mathematically, because I already checked by code, that every natural number can be represented by this sequence with the only weights 1 and -1 and the rule that the possible -1 occupy only the rightmost positions:
1->1
2->1+2-1
3->2+1
4->1+2+1
5->1+2+1+5-1-2-1
6->2+1+5+1-2-1
7->5+1+2-1
8->1+5+1+2-1
9->5+1+2+1
10->1+5+1+2+1
11->1+2+1+5+1+2-1
12->2+1+5+1+2+1
13->1+2+1+5+1+2+1
........
'->' means 'is represented as'