I have the series in the following form: $$x + x(1-y) + x(1-x(1-y)) + x[1-x(1-x(1-y))]\cdots $$ The expansion is very triangly : $$x\\+x-xy\\+x-x^2+x^2y\\+x-x^2+x^3-x^3y\\+x-x^2+x^3-x^4+x^4y\\\cdots$$ This series will go on an arbitrary amount of steps. The point here is that each term is $x(1-P)$ where $P$ is the single term that came right before. Using this idea and setting $P$ appropriately in each loop, a programmed loop in c++ was very easy to write.
Whats this kind of series called? How would I get it into a summation form?
So far what I have is: $$x + \sum_{I=1}\Bigg[x+\Big[\sum_{n=2}^{I}(-1)^{n+1}x^{n}\Big]+(-x)^{I}y\Bigg]$$ Which would expand into the expansion above properly. Is this correct? Please note that the inside summation is meant to be zero when I = 1. I know this converges on $\frac{x}{y}$ from the program I wrote, but I cant seem to remember the associated math.
This whole thing looks familiar, I feel like I have seen it before but I cant quite place it. If possible, please include a term or name I can look up to learn more.
You may define a recurrence as $$a_n = x(1 - a_{n-1}), \quad a_0 = y.$$ Note that this would give you the initial term as $y$, not $x$, as you have written, but that is okay since it only affects one term.
Next, suppose there is a related recurrence $b_n = a_n - k$ for all $n \ge 0$ for some constant $k$ that depends on $x, y$ in such a way that $\{b_n\}_{n \ge 0}$ is a geometric sequence. Therefore, $$b_n + k = x(1 - (b_{n-1} + k)) = x(1-k) - xb_{n-1},$$ or $$b_n = x(1-k) - k - xb_{n-1}.$$ To eliminate the constant term, we thus require $$x(1-k)-k = 0,$$ or $$k = \frac{x}{x+1}.$$ Consequently, $$b_n = a_n - \frac{x}{x+1}$$ is a geometric sequence with common ratio $-x$ and initial term $$b_0 = a_0 - \frac{x}{x+1} = y - \frac{x}{x+1}.$$ Hence $$\sum_{n = 0}^{m-1} a_n = \sum_{n=0}^{m-1} b_n + \frac{x}{x+1} = \frac{mx}{x+1} + \left(y - \frac{x}{x+1}\right) \frac{(-x)^m - 1}{(-x) - 1}. $$ To get your sum where the initial term is $x$ instead of $y$, simply subtract $y$ and add $x$ from the above expression.
For a computational example, suppose we wish to sum $a_n$ from $n = 0$ to $5$ with $x = 3$ and $y = 1/5$. The result with the formula above would be $523/5$, with $m = 6$. The individual terms are $$\left\{\frac{1}{5},\frac{12}{5},-\frac{21}{5},\frac{78}{5},-\frac{219}{5},\frac{672}{5}\right\},$$ the sum of which is indeed $523/5$.