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

Let's group the parameters $a_i$ into two groups, the even and odd numbers (lets call them $e_i$ and $o_i$ resp).
Notice that $2^{\lceil e_i/2 \rceil} = 2^{\lfloor e_i/2 \rfloor} $ while $2^{\lceil o_i/2 \rceil}  = 2 \times 2^{\lfloor o_i/2 \rfloor} $
Now, let $\frac12 <Z<1$ with $Z=\frac{X}{Y}$, where  $ X, Y \in \mathbb{N}$
Let $D=Y-X$  and $C=2X -Y$, with $C, D>0$. Also, $X=D+C$ and $Y=C+2D$.
Then $$Z=\frac{C+D}{C+2D}$$
Further, any natural number can be expressed as sum of powers of two: $C = 2^{c_1} + 2^{c_2} + \cdots 2^{c_j}$, where $(c_1, \cdots c_j)$ correspond to the positions of the ones in the binary digits of its binary representation. Analogously, $D = 2^{d_1} + 2^{d_2} + \cdots 2^{d_k}$
Now, let $e_i = 2 c_i$ and $o_i = 2 d_i +1$, and we are done.

An example follows: Let $Z = \frac{11}{17}$, then
$$C= 2\times 11 -17=5 = 2^0 +2^2 \implies c_i=(0 , 2) \implies e_i=(0 , 4)$$
$$D=17-11=6 = 2^1 + 2^2\implies d_i=(1 , 2)  \implies o_i=(3 , 5) $$
and $a_i = (0,4,3,5)$. Indeed:
$$ 
\dfrac{ 
2^{\lfloor 0/2\rfloor} +
2^{\lfloor 4/2\rfloor} +
2^{\lfloor 3/2\rfloor} +
2^{\lfloor 5/2\rfloor} 
}
{
2^{\lceil 0/2\rceil} +
2^{\lceil 4/2\rceil} +
2^{\lceil 3/2\rceil} +
2^{\lceil 5/2\rceil} 
}
=\dfrac{1+4+2+4}{1+4+4+8}=\dfrac{5+6}{5+2\times 6}=\frac{11}{17}
$$
