Proof that base -2 with binary digits can form every integer

$0$ is obtained via the empty set.

We'll proceed by "simultaneous induction" on the positive and negative integers.

To build up positive base cases we note that $$1=(-2)^0\quad \quad 2=(-2)^2+(-2)^1\quad \quad 3= (-2)^2+(-2)^1+(-2)^0$$

To build up negative base cases we note that $$-1=(-2)^1+(-2)^0\quad \quad -2=(-2)^1\quad \quad -3=(-2)^3+(-2)^2+(-2)^0$$

Now the induction statement we want is "Given that the claim is true for all integers $k$ with $|k|≤n-1$ prove that it is also true for $k=\pm n$."

That plus the base cases will certainly suffice.

To prove the statement, we first note that (using the base cases) we can assume that $n≥4$. Now we distinguish between the cases $n$ even or $n$ odd.

If $n$ is even then $\frac n{-2}$ is an integer with absolute value $<n$ so we can write $$\frac n{-2}=\sum_{i=1}^m(-2)^{a_i}\implies n=\sum_{i=1}^m(-2)^{a_i+1}$$

(here, of course, we are using a proper representation of the smaller number. Thus the $\{a_i\}$ are distinct. If that is the case, then of course the numbers $\{a_i+1\}$ are also all distinct.)

If $n$ is odd then $n-1$ is even and, as before we can write $$\frac {n-1}{-2}=\sum_{i=1}^m(-2)^{a_i}\implies n=\sum_{i=1}^m(-2)^{a_i+1}+(-2)^0$$ and we are done.

The case of $-n$ is more or less identical.

Note that this method is "constructive" in the sense that you can use it to construct the representation of some number, given that you have already got the representations of smaller numbers.


With just the $(-2)^0$ -bit, this can represent $\{0, 1\}$.

With $2$ -bits of values $(-2)^1$ and $(-2)^0$, this can represent $\{-2, -1\}\cup \{0, 1\}$.

With $3$ -bits of values $(-2)^2$, $(-2)^1$ and $(-2)^0$, this can represent $\{-2, -1, 0, 1\} \cup \{2, 3, 4, 5\}$.


Proposition: with $n$ -bits, if $O$ is the greatest odd number smaller than $n$, then the lower bound is the sum $$-2^1 - 2^3 - 2^5 - \cdots -2^O,$$ while if $E$ is the greatest even number smaller than $n$, then the upper bound is the sum $$2^0 + 2^2 + 2^4 + \cdots + 2^E,$$ subject to empty sum when $O$ or $E$ is negative.

Let $S_n$ be the set of integers representable by $n$ -bits.

$$\begin{align*} S_{n} &= \left[-\sum_{0\le i< n, 2\not\mid i}2^i\quad ,\quad \sum_{0\le i< n, 2\mid i}2^i\right]\cap \mathbb Z\\ &= \left[-2\cdot \frac{4^{\lfloor n/2\rfloor}-1}{4-1}\quad ,\quad \frac{4^{\lceil n/2\rceil}-1}{4-1}\right]\cap \mathbb Z\\ &= \left[-2\cdot \frac{4^{\lfloor n/2\rfloor}-1}{3}\quad ,\quad \frac{4^{\lceil n/2\rceil}-1}{3}\right]\cap \mathbb Z\\ \end{align*}$$


Assume that $k$ -bits (of values $(-2)^0, \ldots , (-2)^{k-1}$) can represent the following range of integers, inclusive:

$$\begin{align*} S_{k} &= \left[-2\cdot \frac{4^{\lfloor k/2\rfloor}-1}{3}\quad ,\quad \frac{4^{\lceil k/2\rceil}-1}{3}\right]\cap \mathbb Z\\ \end{align*}$$

Then the next -bit of value $(-2)^k$ can additionally represent integers in the set

$$\begin{align*} T_{k+1} &=\left\{(-2)^k + s \mid s\in S_k\right\}\\ &= \left[(-2)^k-2\cdot \frac{4^{\lfloor k/2\rfloor}-1}{3}\quad ,\quad (-2)^k + \frac{4^{\lceil k/2\rceil}-1}{3}\right]\cap \mathbb Z \end{align*}$$

  • If $k$ is odd and $(-2)^k < 0$, then $(-2)^k = -2^k = -2\cdot 4^{\lfloor k/2\rfloor}$ and the set $T_{k+1}$ is $$\begin{align*} T_{k+1} &= \left[-2\cdot 4^{\lfloor k/2\rfloor}-2\cdot \frac{4^{\lfloor k/2\rfloor}-1}{3}\quad ,\quad -2\cdot 4^{\lfloor k/2\rfloor} + \frac{4^{\lceil k/2\rceil}-1}{3}\right]\cap \mathbb Z\\ &= \left[-2\cdot 4^{\lfloor k/2\rfloor}-2\cdot \frac{4^{\lfloor k/2\rfloor}-1}{3}\quad ,\quad -2\cdot 4^{\lfloor k/2\rfloor} + \frac{4\cdot 4^{\lfloor k/2\rfloor}-1}{3}\right]\cap \mathbb Z\\ &= \left[-2\cdot \frac{3\cdot 4^{\lfloor k/2\rfloor} + 4^{\lfloor k/2\rfloor}-1}{3}\quad ,\quad \frac{-6\cdot 4^{\lfloor k/2\rfloor} + 4\cdot 4^{\lfloor k/2\rfloor}-1}{3}\right]\cap \mathbb Z\\ &= \left[-2\cdot \frac{4\cdot 4^{\lfloor k/2\rfloor}-1}{3}\quad ,\quad -2\cdot\frac{4^{\lfloor k/2\rfloor}-1}{3}-1\right]\cap \mathbb Z\\ &= \left[-2\cdot \frac{4^{\lfloor (k+1)/2\rfloor}-1}{3}\quad ,\quad \min S_k-1\right]\cap \mathbb Z\\ \end{align*}$$

  • If $k$ is even and $(-2)^k > 0$, then $(-2)^k = 2^k = 4^{\lceil k/2\rceil}$ and the set $T_{k+1}$ is $$\begin{align*} T_{k+1} &= \left[4^{\lceil k/2\rceil}-2\cdot \frac{4^{\lfloor k/2\rfloor}-1}{3}\quad ,\quad 4^{\lceil k/2\rceil} + \frac{4^{\lceil k/2\rceil}-1}{3}\right]\cap \mathbb Z\\ &= \left[4^{\lceil k/2\rceil}-2\cdot \frac{4^{\lceil k/2\rceil}-1}{3}\quad ,\quad 4^{\lceil k/2\rceil} + \frac{4^{\lceil k/2\rceil}-1}{3}\right]\cap \mathbb Z\\ &= \left[\frac{3\cdot 4^{\lceil k/2\rceil} - 2\cdot 4^{\lceil k/2\rceil}+2}{3}\quad ,\quad \frac{3\cdot 4^{\lceil k/2\rceil} + 4^{\lceil k/2\rceil}-1}{3}\right]\cap \mathbb Z\\ &= \left[\frac{4^{\lceil k/2\rceil}-1}{3}+1\quad ,\quad \frac{4\cdot 4^{\lceil k/2\rceil}-1}{3}\right]\cap \mathbb Z\\ &= \left[\max S_k+1\quad ,\quad \frac{4^{\lceil (k+1)/2\rceil}-1}{3}\right]\cap \mathbb Z\\ \end{align*}$$

In both cases, the set of integers representable by $k+1$ -bits is

$$\begin{align*} S_{k+1} &= S_k \cup T_{k+1}\\ &= \left[-2\cdot \frac{4^{\lfloor (k+1)/2\rfloor}-1}{3}\quad ,\quad \frac{4^{\lceil (k+1)/2\rceil}-1}{3}\right]\cap \mathbb Z\\ &= \left[-\sum_{0\le i< k+1, 2\not\mid i}2^i\quad ,\quad \sum_{0\le i< k+1, 2\mid i}2^i\right]\cap \mathbb Z\\ \end{align*}$$


By induction, with $n$ -bits all integers between $-2\cdot \dfrac{4^{\lfloor n/2\rfloor}-1}{3}$ and $\dfrac{4^{\lceil n/2\rceil}-1}{3}$ inclusive are representable.

So for any $a\in\mathbb Z$, $a$ will be representable as a base-$(-2)$ number with a sufficient number of -bits.