This is not a homework problem. I really tried to solve it on my own for some time but haven't gotten far. I suspect this problem may exceed my fairly rusty high-school math. Or, the solution is totally trivial and I just can't see it. I'm looking for a (preferably non-recursive) definition of the following series, which starts at 1:
$$0, \;\frac{1}{2},\; \frac{1}{4}, \;\frac{3}{4},\; \frac{1}{8},\; \frac{3}{8},\; \frac{5}{8},\; \frac{7}{8},\; \frac{1}{16}, \;\ldots$$
(Perhaps $a_1=0$ is an exception and it is better to start with $2$.) The series is obtained from dividing a line into subsequently smaller pieces. In my practical application I need to allocate memory for tasks on a shared stack. Task 1 gets starting position $0$, task 2 position $\frac{s}{2}$, task 3 position $\frac{s}{4}$, and so on, where $s$ is the stack size. The stacksize does not seem to play any role, so I ignore it. The only thing I've gotten so far is this:
If $n-1=2^k$ for integer $k$, then $a_n=\frac{1}{2n-2}$.
If I'm not mistaken, the above condition determines $a_2=\frac{1}{2}$; $a_3=\frac{1}{4}$; $a_5=\frac{1}{8}$; $a_9=\frac{1}{16}$.
But how do I get all the intermediate steps?
I cannot even come up with a recursive definition, let alone a formula that gives me the result without referring to previous results.
