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.
$$