I have tasked myself with writing a function that will count up to a number in a dynamic fashion, that means it'll start with large steps that become smaller and smaller as the counter reaches the target. So while at first it would start counting in the thousands, at the end it would only increment using 1.
However, it seems I have lost all mathematical ability since leaving school. I cannot for the time of my life come up with the algorithm! There is only half-ideas and flashes, but nothing like "start like so, then for every iteration check this and that, calculate the increment by whatever and increment"; I can design and implement complex applications, but I cannot see this one algorithm.
When plotting the counter value it should look similar to this image (taken from a wikipedia article about Sigmoid functionsw), more precisely like the upper right quadrant: it increases steeply at first and then flattens ever more.
So here goes the challenge:
Can anyone tell or show me the algorithm (easy, I think) and can anybody explain this algorithm to me, maybe step by step.








Logged









