I am trying to make a for loop which calculates the following
#x_i = (1+1/i)x_{i-1}
with x_0=1
I know how to do the first part which is
for i in range(1, 3):
print(1+1/i)
I am not sure how to make the x_{i-1}
work, so it should take the previous iteration and use the calculated value in making the new x
.
So the final result I am looking for would be a list, looks as follow:
#[1, (1 + 1/1), (1 + 1/1)(1 + 1/2),(1 + 1/1)(1 + 1/2)(1 + 1/3),...]