Iterative Equation Problem with Constraints I was given a programming riddle recently.  It was eluded to that there is an equation, but I was told that finding the equation was not the goal, and that writing a simple program was the goal.  I solved the riddle and wrote a program, so have not included that all here.
However, I've spent a lot of time trying to figure out if there is an equation or not, and the source of this question wouldn't tell me. So I'd like to propose the issue here in hopes for help (or just the answer).  It's killing me.
Solve for x so that x = Lowest Number Possible.
Given i = Variable Whole Number > 1
Constraints are as follows:


*

*No. of Iterations = i + 1

*The equation for each iteration is: x = ((x-1)/i)*(i-1)

*Every iteration must end in a non-zero WHOLE Number


So for i=2, (The answer is 15 7) this would occur:
x = ((7-1)/2)*(2-1) = 3
x = ((3-1)/2)*(2-1) = 1
x = ((1-1)/2)*(2-1) = 0

For i=3, (x starts as 79, so the answer is 79)
x = ((79-1)/3)*(3-1) = 52
x = ((52-1)/3)*(3-1) = 34
x = ((34-1)/3)*(3-1) = 22
x = ((22-1)/3)*(3-1) = 14



*

*For i=4, x=1021

*For i=5, x=15621

*For i=6, x=279931

*For i=9, x=3486784393

 A: Here this isn't an answer but its too long to be a comment, it's a formula for the $k^{th}$ iteration:
Define $f_k(x)$ to be the composition of $(x-1)\frac{i+1}{i}$ with itself $k$ times.
For simplicity define $c=\frac{i+1}{i}$:
$$f_1(x)=(x-1)c=xc-c$$
$$f_2(x)=(xc-c)c-c=xc^2-c^2-c$$
$$f_3(x)=(xc-c)c^2-c^2-c=xc^3-c^3-c^2-c$$
$$f_4(x)=(xc-c)c^3-c^3-c^2-c=xc^4-c^4-c^3-c^2-c$$
$$f_5(x)=(xc-c)c^4-c^4-c^3-c^2-c=xc^5-c^5-c^4-c^3-c^2-c$$
$$\vdots$$
$$f_k(x)=xc^k-(c^k+c^{k-1}+c^{k-2}+c^{k-3}+\cdots c^3+c^2+c)=xc^{k}-c\frac{c^k-1}{c-1}$$
And since $\frac{i+1}{i}=1+\frac{1}{i}$ we have that:
$$f_k(x)=x(1+\frac{1}{i})^k-(1+\frac{1}{i})\frac{(1+\frac{1}{i})^k-1}{\frac{1}{i}}$$
$$=x(1+\frac{1}{i})^k-(i+1)((1+\frac{1}{i})^k-1)=x(1+\frac{1}{i})^k-(i+1)(1+\frac{1}{i})^k+i+1$$
$$=(1+\frac{1}{i})^k(x-(i+1))+i+1$$
So finally we have: $$f_k(x)=(i+1)^k\frac{(x-(i+1))}{i^k}+i+1$$
A: Thank you to Eric Towers for this answer. It is infinitely better than what I had, and as his answer stands now, it is almost perfect.
I actually don't understand the equation I came up with here, but it's a small part of Eric's answer which I think he over-complicated.  I have to say that the over-complication was probably because of the i=2, x=15 thing.  This answer does come up with 7 for x, which I think everybody would agree is the "correct" answer.  I think the constraint of "Non-Zero" was thrown into the original riddle to avoid this equation from being found.
$$ 1 + \sum_{j=1}^{i} i^j(i-1) $$
Without Summation, once again thanks to Eric Towers, is:
$$ i^{i+1}-i+1 $$
Long story short, this equation calculates everything other than i(2)=x(15).  Which I'm just going to call BS on at the person who gave me the riddle.
So while I don't know what's going on in this equation, it's the equation that works and is based on Eric Towers' answer, which I'll give credit for correct.
