Definition:Balanced Ternary Representation

Definition
Let $n \in \Z$ be an integer.

Balanced ternary representation is the unique representation of $n$ in the form:


 * $\sqbrk {r_m r_{m - 1} \ldots r_2 r_1 r_0}$

such that:
 * $\ds n = \sum_{j \mathop = 0}^m r_j 3^j$

where:
 * $m \in \Z_{>0}$ is a strictly positive integer such that $3^m \le \size n < 3^{m + 1}$
 * all the $r_j$ are such that $r_j \in \set {\underline 1, 0, 1}$, where $\underline 1 := -1$.

Also see

 * Representation of Integers in Balanced Ternary for a proof that all integers can be represented uniquely in such a form.