Apologies, complete math novice here
I have a number, x. I want to divide this by another number, y (to be determined), such that when you repeatedly divide this and add the value to x, eventually you'll reach <1 after z times.
E.g. if we consider x = 400, and we want to take 20 iterations, our solution is approx 3.73, because:
#1: 400 / 3.73 = 107, x = 400-107 = 293
#2: 293 / 3.73 = 78.5, x = 293 - 78.5 = 214.5
#3: 214.4 / 3.73 = 57.5, x = 214.5 - 57.5 = 157
And so on... after 20 iterations we'll get an answer of <1
How can I determine the divisor in advance when I know what the initial values is (400), and the number of steps (20)?
Thank you
Background: I'm trying to build a number counter/rotator that cycles from a->b within a given time period (defined by the number of iterations, each iteration will take place in uniform time), where the rate of change progressively slows down the closer it reaches the target, i.e. in the above example it'll add 107, then 78.5, then 57.5, and so on, progressively slowing down as it gets closer to the target, finally reaching it (or close to) on the nth iteration.
The idea is each division provides a smaller and smaller movement to edge the cumulative value towards the target. I'm sorry for the bad phrasing.
– JamShady Mar 01 '22 at 15:30$$x \mapsto x -\frac xy = x\left(1-\frac1y\right)$$
So effectively, each iteration the starting value is multiplied by $1-\frac1y$. After $z$ iterations, the result will be $x\left(1-\frac1y\right)^z$.
– peterwhy Mar 01 '22 at 15:48