Representing all rational numbers between $\dfrac{1}{2}$ and $1$ How do I show that
$$\dfrac{2^{\left\lfloor\frac12 a_1\right\rfloor} + 2^{\left\lfloor\frac12 a_2\right\rfloor}  + \ldots + 2^{\left\lfloor\frac12 a_n \right\rfloor}}{2^{\left\lceil\frac12 a_1\right\rceil} + 2^{\left\lceil\frac12 a_2\right\rceil} + \ldots + 2^{\left\lceil\frac12 a_n \right\rceil}}$$
represents all rationals between $\dfrac{1}{2}$ and $1$, where $a_1, a_2, \ldots, a_n \in \mathbb{N}$?
I have tried representing few rationals such as $\dfrac{7}{8}$ and $\dfrac{5}{8}$ and it seems like we can represent all of them. However I'm not completely sure why and don't have a rigorous proof.
For example
$$\dfrac{5}{8} = \dfrac{2^{\left\lfloor\frac12 3\right\rfloor} + 2^{\left\lfloor\frac12 4\right\rfloor}  + 2^{\left\lfloor\frac12 5 \right\rfloor}}{2^{\left\lceil\frac12 3\right\rceil} + 2^{\left\lceil\frac12 4\right\rceil} + 2^{\left\lceil\frac12 5 \right\rceil}}$$
$$\dfrac{7}{8} = \dfrac{2^{\left\lfloor\frac12 1\right\rfloor} + 2^{\left\lfloor\frac12 2\right\rfloor}  + 2^{\left\lfloor\frac12 4 \right\rfloor}}{2^{\left\lceil\frac12 1\right\rceil} + 2^{\left\lceil\frac12 2\right\rceil} + 2^{\left\lceil\frac12 4 \right\rceil}}$$
Any help would be highly appreciated. Thanks

We can observe that $2^{\lfloor a/2 \rfloor}$ and $2^{\lceil a/2 \rceil}$ are simply powers of $2$ which are either equal or consecutive. Hence:
$$2^{\lfloor a/2 \rfloor} \leqslant 2^{\lceil a/2 \rceil} \leqslant 2 \cdot 2^{\lfloor a/2 \rfloor}$$
Taking these bounds in our expression shows that any rational expressed in the given form must be between $\frac{1}{2}$ and $1$. Now, we will show that all rationals in $[\frac{1}{2},1]$ can be expressed in the given form by inducting over the size of the denominator.
The result holds good when the denominator is $1$ or $2$, by expressing $1$ and $\frac{1}{2}$ as they are. Now, assume that we are to show that $\frac{x}{y}$ can be expressed in the given form.
First, we can see that since $\frac{x}{y}<1$, it follows:
$$\frac{x-1}{y-1}<\frac{x}{y}<1$$
Moreover, if we assume $\frac{x-1}{y-1}<\frac{1}{2}$, then:
$$\frac{x-1}{y-1}<\frac{1}{2}<\frac{x}{y} \implies 2x-1<y<2x$$
which is clearly a contradiction. Hence, $\frac{x-1}{y-1}$ lies in $[\frac{1}{2},1]$ and can thus be expressed in the given form. Now, simply write $\frac{x}{y}$ in the given form by writing:
$$\frac{x}{y} = \frac{(x-1)+1}{(y-1)+1}$$
Note: Sometimes, the fraction $\frac{x-1}{y-1}$ might not be in simplified form. Simply consider the expression of this rational number in its simplest form, and repeat the terms in the numerator and denominator till the sum in the numerator is $x-1$ and in the denominator is $y-1$.
Example: Assume we need to express $\frac{16}{25}$ in the given form. We first write:
$$\frac{16}{25} = \frac{15+1}{24+1}$$
Now, we have:
$$\frac{15}{24}=\frac{5}{8}=\frac{2+2+1}{4+2+2}$$
Hence:
$$\frac{16}{25} = \frac{3(2+2+1)+1}{3(4+2+2)+1} = \frac{2+2+2+2+2+2+1+1+1+1}{4+4+4+2+2+2+2+2+2+1}$$
