Definition:Basis Expansion

Positive Real Numbers
Let $$x \in \R$$ be a real number such that $$x \ge 0$$.

Let $$b \in \N: b \ge 2$$.

Let us define the recursive sequence:
 * $$\forall n \in \N: n \ge 1: \left \langle {f_n}\right \rangle = \begin{cases}

b \left({x - \left \lfloor {x} \right \rfloor}\right) & : n = 1 \\ b \left({f_{n-1} - \left \lfloor {f_{n-1}} \right \rfloor}\right) & : n > 1 \end{cases}$$

Then we define:
 * $$\forall n \in \N: n \ge 1: \left \langle {d_n}\right \rangle = \left \lfloor {f_n} \right \rfloor$$

It follows from the method of construction and the definition of the floor function that:


 * $$\forall n: 0 \le f_n < b$$ and hence $$\forall n: 0 \le d_n \le b - 1$$;
 * $$\forall n: f_n = 0 \implies f_{n+1} = 0$$ and hence $$d_{n+1} = 0$$.

Hence we can express $$x = \left \lfloor {x} \right \rfloor + \sum_{j \ge 1} \frac {d_j} {b^j}$$ as:
 * $$\left[{s . d_1 d_2 d_3 \ldots}\right]_b$$

where $$s = \left \lfloor {x} \right \rfloor$$.

This is called the expansion of $$x$$ in base $$b$$.

The generic term for such an expansion is a basis expansion.

It follows from the Division Theorem that for a given $$b$$ and $$x$$ this expansion is unique.

If it is the case, for a given $$x$$ and $$b$$, that $$\exists m \in \N: d_m = 0$$ then the expansion is said to terminate.

Note that it is far from guaranteed that the sequence $$\left \langle {d_n}\right \rangle$$ will actually terminate.

Negative Real Numbers
Let $$x \in \R: x < 0$$.

We take the absolute value $$y$$ of $$x$$, i.e. $$y = \left|{x}\right|$$.

Then we take the expansion of $$x$$ in base $$b$$:
 * $$\left[{s . d_1 d_2 d_3 \ldots}\right]_b$$

where $$s = \left \lfloor {x} \right \rfloor$$.

Then:
 * $$y = -\left[{s . d_1 d_2 d_3 \ldots}\right]_b$$

Also see

 * The Existence of Base-N Representation‎ for a rigorous proof that this expansion always exists and (except in a particular case) is unique.


 * The Basis Representation Theorem for the equivalent theorem for integers.