Disclaimer: I'm a 19 year old who didn't pay enough attention in math class, so there is likely a very simple solution to this that I just can't think of.
I'm writing an algorithm that will run forever. For unrelated reasons, I want to sum up to 1 billions during steps 1 through 2,628,000. The catch is, I would like to decrease the value that is getting summed as
n, the number of iterations, increases. I will always be starting at 0 and want to sum up to exactly 1 billion after 2,628,000 iterations.
In other words, lets say I wanted to do this in 10 iterations with the number 100, starting at 0:
- 0 + 27
- 27 + 18
- 45 + 15
- 60 + 11
- 71 + 10
- 81 + 8
- 89 + 6
- 95 + 3
- 98 + 1.5
- 99.5 + 0.5
I've looked at quadratic bezier curves as they seem to do what I want but I've read that it's very difficult (or impossible) to calculate y based on x (x in my case would be the iteration number).
Any help with a formula would be very much appreciated.