- #1
3ToedSloth
- 4
- 0
Hi, I'm new here and, as will become obvious from my question, neither a phycisist nor a mathematician. This is not a homework question, so I post it in this forum and hope that's okay. (I've aready asked on stack exchange but as far as I can see the answers given to me there were describing a different sequence.)
I need to find a non-recursive formula for determining the members of the sequence that starts as follows:
[itex]a_1=0,\; a_2=\frac{1}{2},\; a_3=\frac{1}{4},\; a_4=\frac{3}{4},\; a_5=\frac{1}{8},\; a_6=\frac{3}{8},\; a_7=\frac{5}{8},\; a_8=\frac{7}{8},\; a_9=\frac{1}{16}, ...[/itex]
Imagine a line that is subsequently divided into more fine-grained segments by dividing all of the previous segments, going from left to right. (For the record, it's in fact a programming problem. I need to split up a large chunk of memory into separate areas on the basis of a given number of tasks, and this number may change dynamically at runtime.)
I cannot even find a proper recursive definition. So far I've only come up with this: If [itex]n-1[/itex] is a power of two, then [itex]a_n=\frac{1}{2n-2}[/itex].
But I simply can't figure out how to get the values in-between like 3/4, 3/8, 5/8, 7/8, 3/16, ... and combine everything into one simple formula. It's driving me nuts.
P.S.: In case this is really the wrong place to ask (it's not exactly about top-notch research in theoretical physics), I'd be happy for pointers to other places to ask these kind of questions.
I need to find a non-recursive formula for determining the members of the sequence that starts as follows:
[itex]a_1=0,\; a_2=\frac{1}{2},\; a_3=\frac{1}{4},\; a_4=\frac{3}{4},\; a_5=\frac{1}{8},\; a_6=\frac{3}{8},\; a_7=\frac{5}{8},\; a_8=\frac{7}{8},\; a_9=\frac{1}{16}, ...[/itex]
Imagine a line that is subsequently divided into more fine-grained segments by dividing all of the previous segments, going from left to right. (For the record, it's in fact a programming problem. I need to split up a large chunk of memory into separate areas on the basis of a given number of tasks, and this number may change dynamically at runtime.)
I cannot even find a proper recursive definition. So far I've only come up with this: If [itex]n-1[/itex] is a power of two, then [itex]a_n=\frac{1}{2n-2}[/itex].
But I simply can't figure out how to get the values in-between like 3/4, 3/8, 5/8, 7/8, 3/16, ... and combine everything into one simple formula. It's driving me nuts.
P.S.: In case this is really the wrong place to ask (it's not exactly about top-notch research in theoretical physics), I'd be happy for pointers to other places to ask these kind of questions.