Let $\{x_n\}_{n=1}^\infty$ be a sequence satisfying the recurrence relation:
$$ x_n = a\left(1- \sum_{k=0}^{n-1}x_k\right) $$
Where $ x_0 = 1 $, and $a \in [0,1]$ is chosen so that $$ \sum_{k=1}^{\infty} x_k = 1$$
Given a positive integer $d$, how do I generate a sequence $\{y_n\}$ such that
$$ \sum_{k=p}^{p+(d-1)} y_k = x_{\frac {p+(d-1)}d}$$
for example, if $a = 0.5$ and $d = 4$,
$$ \sum_{k=1}^{4} y_k = x_1 = 0.5 $$
and
$$ \displaystyle \sum_{k=5}^{8} y_k = x_2 = 0.25 $$
I originally thought that this would be related to compound interest, but doing arithmetic by hand, have not found this to be the case.
I have limited mathematical knowledge, so if the answer requires anything beyond algebra, please explain or cite references to the form you are using. If the title of the question can be made clearer, please feel free to edit.
My use case is a computer application that will calculate $ g(x) $ from $x = 0$, so iterative solutions work for me.