I am trying to find a formula that allows to me calculate how many times a dollar amount can fit into a larger dollar amount, where the amount keeps increasing each time the full amount is reached.
For example, if the starting price is 1 dollar and I have 100 dollars, the first dollar takes me down to 99 dollars, but now the next amount has increased by 1% to 1.01 dollars, now my total is 97.99 dollars and now the 1.01 dollars increase by a further 1%, etc.
I hope my explaining is clear enough, if any further details are required, please let me know.
Any help would be much appreciated.
Thanks.
The following pseudocode demonstrates what I think you're doing - correct me if I'm wrong.
Then your example has
remaining = 100,start_subtract = 1,interest = 1.01, and a quick Python program determines the answer to be 69 steps. The above is just by way of a sanity-check on the answer I derive below.Note that the amount we're taking out at time-step $n$ (where the first time-step is $n=1$ and we take out $1$ dollar in your example) is $a \times c^{n-1}$. So the amount taken out before-and-including time-step $n$ is $$a \times (1 + c + \dots + c^{n-1}) = a \times \frac{c^n-1}{c-1}$$
So you're asking for the largest $n$ such that $b > a \times \frac{c^n-1}{c-1}$; i.e. such that $$\log\left(\frac{(c-1)b}{a} + 1\right) / \log(c) > n$$
Since that thing on the left is just a number, this is easy to find. When $c=1.01, b=100, a=1$, the left-hand side is about $69.661$, so we get $n=69$.