Solve this Riddle if you can


In Gil-Gandel's problem the answer is any integer up to 40g. If it balances with the 1g, it is one gram. If it balances on the same side as the 1g while opposite the 3g, it is 2g. 3 and 4 are obvious, 5 balances 9 on one side with the 1 and 3 on the other. This can be followed for any number up to 40. For example, if the weight is 32g, it will balance with 27g and 9g on the opposite side, and 3g and 1g on the same side
Four years on, and I now rediscover this. That rediscovery led to me proving by induction that the sum of powers of three to n is equal to (3^(n+1)-1)/2. Good times