Or directly get the last digits from (-1, 0, 1)
100 = 33 * 3 + 1
33 = 11 * 3 + 0
11 = 4 * 3 + (-1)
4 = 1 * 3 + 1
1 = 0 * 3 + 1
Collect those digits together, we get 11X01_3
On 2010-8-31 23:40, Dave wrote:
352/9 = 39-1/9
= 27 + 9 + 3 + 1/9
= 1*3^3 + 1*3^2 + 1*3^1 + 0*3^0 +
352/9 = 39-1/9
= 27 + 9 + 3 + 1/9
= 1*3^3 + 1*3^2 + 1*3^1 + 0*3^0 + 0*3^(-1) + 1*3^(-2)
= 1110.01_3
Another example, where -1 comes into play:
Using ordinary ternary {0,1,2} representation:
100 = 1*3^4 + 0*3^3 + 2*3^2 + 0*3^1 + 1*3^0
= 10201_3{0,1,2}
Now transform into the {0,1,-1}