It's obvious that if, when you lose a coin flip, you increase your bet by some certain amount and win, your total profit will be the same as if you had won the first flip. The question is what that value is. So instead of trying to work it out directly, I say, "let's just pick a random value for how much I increase by, then work out how much I would need to win in order for the above to be true", then invert the result. If I increase my bet by `2`, then for any given number of bets I make, my cost will be the bet (`1`) plus the previous bet (`1/2`) plus the one before (`1/4`), etc. So I need to create a function that shows me how much I have spent so far, by the number of terms. So if it's the 5th bet, I need to be able to say "`cost = f(5)`". Now, if I've made 5 bets, I know that the first bet is equal to `1/16` of my current bet, for 4 bets, it's `1/8`, for three bets it's `1/4`, for two bets it's `1/2`, for only one bet, the first is equal to the last - a value of `1`. In other words, for any `x` bet, the first bet is equal to `1/(2^x)`. This is a part where I just have to know; and seeing a `1,2,4,8,16,32` sequence is something that makes me just know that it's `2^x`. It's easy to show that it's right, by just plugging in values of `x` and watching the sequence appear. It's hard to prove it the other way around, but I won't bother doing that. They are the same, we can show they're the same, so we don't care about how we got there. So this `1/(2^x)` thing. Now we have that, we have a sum we can work with. To get the cost of every bet in a sequence, in relation to the last bet, we do the sum of `1/(2^x)` where `x` is from `1` (the last bet) to `n` (the first bet). How do we resolve that? Fucking magic. I'm not very good with sums. The important thing to note is that if you do this for some really high value of `x`, you will grow closer and closer to `2`, without ever reaching it. And that knowledge makes it incredibly easy. This allows us to track how far away from `2` we are, instead of how far away from `1`. The sequence of how far away we are is `1`, `1/2`, `1/4`, `1/8`, `1/16`, etc., which as we know from earlier is `1/(2^x)`. Well, almost. There's a slight difference here. Because `2^1` is `2`, our first bet would put us `0.5` away from `2`. That's not right. So we need to make it `1/(2^(x-1))` because `2^0` is `1`. This is a mistake I made earlier as well, but it's not super important to get right until now. So now we have this graph, `2-1/(2^(x-1))`, which shows us the ratio of how much the current bet (`x`) costs vs how much we've spent total. We know this ratio will get closer and closer to `2` without reaching it, so if we win `2* our bet` when we do win, that means we will always make a profit. If we win more than `2*`, we will definitely always make a profit, but if we win any less, then at some point we'll start making a loss. So the pivotal value here is `2`. Oh, and note that `2-1/(2^(x-1))` is functionally identical to `2-(1/2)^(x-1)`, due to how fractional multiplication works, and thus also the same as `2-0.5^(x-1)`. So now we have to figure out how all that works for a bet increase other than `2`. So let's say I triple my bet each time, instead. So for my current bet, the previous bet is `1/3` the current, the one before that is `1/9` the current, `1/27`, etc. Which is pretty obviously `1/3^(x-1)`. So we need to do that sum again, of that from `1` to `n`, and again, we just put some stupidhigh value of x into it and watch what it grows to. It's `1.5`. It never quite makes it there no matter how far you go. So we can do the above again, tracking how far away we are from `1.5`. So it's `1.5-(1/3)^(x-1)`. So we know what we're doing here now. We have a relationship between how much we increase, and what number we peak at (which is also how much we need to be winning to maintain a steady profit). `2=2`, `3=1.5`. `4=1.333333e`. So now we need to create yet another function, one that describes this relationship. Note that, if you don't increase your bet at all, you would need to win an infinitely high amount of money to make up for it. Because if I bet `1` 100 times, then on the last bet if I win, I need to win `100` to win back all that I lost. Say `101` in order to make a profit. But if betting `1` gives me `101` back, then that means my first bet, which was also `1`, would have given me `100` profit, as opposed to the profit of `1` I got on the last flip. There is no amount of profit I can make that will make those become equal, because they scale at the same rate; `99` apart forever. So the sequence above has the point `1=infinite`. This is a very important data point. We know that the function we intend to create will grow to incredible size the closer it gets to `1` (from above), while on the other side, it will grow closer to `1`. (If I increase my bet by `10000000*` each turn, I would only need to yield something like `1.00000001` in order to mantain a stable profit. If you win back less than you bet, then again, there is no solution - you will never be able to maintain a stable profit, it'll start negative and just go down from there.) And this is where we get back into the "I just know" thing. What kind of graph has a hardcap on the lower `x` and lower `y`? A `1/x` graph. If you just do `y=1/x`, you'll see that (in the positive quadrant), `x` can't go below `0`, and `y` can't go below `0`. So that's our base form for understanding this. What we need to do now, is adjust it to fit. Since our lower `y` bound is `1`, not `0`, we need to add `1` to every value. `y=1/x+1`. And, since our `x` value can't go below `1`, we need to modify `x` in the narrowest scope, such that when `x=1`, the value would be `0` instead. In other words, we need to subtract `1` from `x`. `y=1/(x-1)+1` is our graph, now. Now let's test it. `1=infinite`, `2=2`, `3=1.5`. `4=1.333333e`. This is our sequence. So for `x=1`, that causes division by `0`, which is close enough to `infinity`. `x=2`, `y=1/(2-1)+1`, `y=1/1+1`, `y=1+1`, `y=2`. Looks good. `x=3`, `y=1/2+1=1.5`. Looks good. `x=4`, `y=1/3+1=4/3=1.333333e`. Looks very good. So we have a function that fits the formula. For any increase value, `x`, we would need a yield of `1/(x-1)+1` to maintain a stable profit. Now for the absolute final step: Inverting that. Since I generally know the profit, `y`, and want to find the `x`, I need to rearrange that equation until it looks like `x=f(y)`. `y=1/(x-1)+1` `y-1=1/(x-1)` `(x-1)(y-1)=1` `x-1=1/(y-1)` `x=1/(y-1)+1` Which is actually the same but with `x` and `y` swapped. A handy little feature of the `y=1/x` graph form. (Since you have probably noticed that it is symmetrical along the `y=x` line.) Now, to clean it up a tiiiiiiiny bit more, I'll do another few steps: `x=1/(y-1)+(y-1)/(y-1)` (since `(y-1)/(y-1)=1`, except for `y=1`, but this function falls apart when `y=1` anyway, so who cares?) `x=(1+(y-1))/(y-1)` `x=(y+1-1)/(y-1)` `x=y/(y-1)` And behold, this is the `n=x/(x-1)` formula I came up with, just with the letters changed. As long as we know what each letter represents it doesn't really matter anyway. So that's why you should increase your bet by `n` (multiply) for any given yield, `x`.