TITLE: Understanding expansion on base $k$
QUESTION [5 upvotes]: There are some times when one might need to use expansion of real numbers on some base $k$. One example is when dealing with Cantor's set, one uses expansion of the numbers inside $[0,1]$ on base $3$. The point is that I simply can't understand these expansions. I'm asking here on the more general context of expansion on base $k$ in order to try to make the question more useful.
As I understood, expansion of a number $a\in \mathbb{R}$ in base 3 means to write
$$a = \sum_{n=1}^\infty \dfrac{a_n}{3^n} \quad a_n \in \{0,1,2\}.$$
In that setting, I imagine expansion of $a$ in base $k$ would mean to write
$$a = \sum_{n=1}^\infty \dfrac{a_n}{k^n} \quad a_n \in \{0,1,\dots, k-1\}.$$
Now what those expansions really mean? I simply can't understand, we are decomposing numbers as certain series. But what those series really mean? Why would anyone consider doing these expansions? What the coefficients $a_n$?
I believe this is related to decimal expansions, that is when we write a number $a = a_0.a_1a_2a_3\dots$ but I'm unsure how to make this connection rigorous. Also, I believe this would be true just for $k=10$, so for the other cases it would still be something hard to grasp.
In truth, I've seem quite a few times this being used in some proofs, the Cantor set being the most well-known example. But up to now I never understood correctly what these expansions are and how to work with them.

REPLY [2 votes]: Here is an example:

Here the number $x=0.6$ is written in the usual decimal notation.
When we go from $x=0.6$ on the axis following the vertical line down through the blue pattern corresponding to the binary expansion, writing down a $0$ if we enter the bottom half of the next subdivision and $1$ if we enter the upper half of the next subdivision, we get the sequence $1,0,0,1,1,0$.
If we instead go from $x=0.6$ on the axis up through the red pattern corresponding to the ternary expansion writing $0$ for entering the lower third, $1$ for entering the middle third, and $2$ for entering the upper third, we get the sequence $1,2,1,0$.
This corresponds to the relations
$$
0.6_{10}\approx 0.100110_2\approx 0.1210_3
$$
with the subscripts referring to the relevant bases. Equivalently
$$
\frac{6}{10}\approx\frac1{2}+\frac0{4}+\frac0{8}+\frac1{16}+\frac1{32}+\frac0{64}\approx\frac13+\frac29+\frac1{27}+\frac0{81}
$$

As you probably know, the binary system can often be handy when dealing with computer science. Both binary and ternary may be relevant in tree structures of trees branching into either two or three subdivisions at each vertex.

Another fun fact is that rational numbers always have a tail of repeating patterns of the coefficients in expansions in any base $k$. In the current example one may show that
$$
0.6_{10}=0.10\overline{1100}_2=0.\overline{1210}_3
$$
where the latter two repeat their overlined patterns forever, as can be seen here.