Given an integer n and a positive real number s, how can I partition an interval [0..1] into n intervals such that L(i+1)=s L(i) where L(i) is length of i'th interval?
Looking for solution in Mathematica or self-contained C-like pseudo-code
Given an integer n and a positive real number s, how can I partition an interval [0..1] into n intervals such that L(i+1)=s L(i) where L(i) is length of i'th interval?
Looking for solution in Mathematica or self-contained C-like pseudo-code
If first interval is a1, then sum of n intervals
s^n - 1
a1 * ----------- = 1,
s - 1
s - 1
a1 = -------------.
s^n - 1
Like this?
s = 2;
n = 10;
L1 = (s - 1)/(s^n - 1);
interval = L1 s^Range[0, n - 1]
Total@interval
You just need to work out the length of the first interval L1 (very easy) and you're done.