How to represent an arbitrary real number in $[0,1)$ [closed]

Let $$\{a_k\}_{k\geq 1}$$ be a sequence of positive integers such that each $$a_k > 1$$. Show that every real number $$x\in[0,1)$$ can be represented as $$x=\sum_{k=1}^\infty\frac{x_k}{a_1a_2 \cdots a_k} ,$$ where $$x_k\in\{0,1,...,a_k-1\}$$.

Edit: This is part of Theorem 1.6 in Ivan Niven's Irrational numbers.

When $$a_k = 10$$ for all $$k$$, this becomes the well-known fact that every number in base-$$10$$ expansion $$0.x_1x_2x_3x_4\cdots$$.

closed as off-topic by user21820, José Carlos Santos, Saad, GNUSupporter 8964民主女神 地下教會, Xander HendersonMar 26 at 14:12

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – user21820, José Carlos Santos, Saad, GNUSupporter 8964民主女神 地下教會, Xander Henderson
If this question can be reworded to fit the rules in the help center, please edit the question.

Choose $$n_1=\lfloor a_1x\rfloor\in[0,a_1-1]$$ so that $$x_2=a_1x-n_1=a_1x-\lfloor a_1x\rfloor\in [0,1)$$. Construct inductively $$n_k$$ and $$x_{k+1}$$ by $$n_k=\lfloor a_k x_k\rfloor,\quad x_{k+1}=a_kx_k-n_k\in [0,1).$$ Then we can prove inductively that $$(*)\ : \ x-\frac{n_1}{a_1}-\frac{n_2}{a_1a_2}-\cdots-\frac{n_k}{a_1a_2\cdots a_k}=\frac{x_{k+1}}{a_1a_2\cdots a_k}\in [0,\frac1{a_1\cdots a_k})\subset [0,2^{-k}).$$ That is, assuming $$(*)$$ is true for $$k$$, we have \begin{align*} x-\frac{n_1}{a_1}-\frac{n_2}{a_1a_2}-\cdots-\frac{n_k}{a_1a_2\cdots a_k}-\frac{n_{k+1}}{a_1a_2\cdots a_{k+1}}&=\frac{x_{k+1}}{a_1a_2\cdots a_k}-\frac{n_{k+1}}{a_1a_2\cdots a_{k+1}}\\&=\frac{a_{k+1}x_{k+1}-n_{k+1}}{a_1a_2\cdots a_{k+1}}\\&=\frac{x_{k+2}}{a_1a_2\cdots a_{k+1}} \end{align*} holds for $$k+1$$. It follows $$x-\sum_{k=1}^N\frac{n_k}{a_1a_2\cdots a_{k-1}a_k}\xrightarrow{N\to\infty} 0.$$