I do love math. For those of you that can watch this unfold, please do. It's kinda cool.
Let's make the problem simple. I have 1005 dollars. I can buy gems starting @ 2 dollar, and they go up .50 each time I buy a new one. Very similar to the FP for coins model used in FoE.
Here's your variables:
Y = bank of dollars (1005)
G = cost of the first gem (2)
X= Cost of each additional gem (.5)
N = how many gems can you buy?
You want to know how many gems you can buy, so the equation for that is expanded to look like this:
Y = G + (G + X), + (G + 2X) + ... + (G + NX)
If you rearrange the terms, you get this:
Y = (N+1) G + (1+2+3+...+N) X
As it turns out, 1+2+3+...+N = (N² + N)X/2
So ... the equation to solve for Y is:
Y = (N+1)G + (N² + N)X/2
If you plug in the values of Y = 1005, G = 2 and X=.5 ... you'll see N = 59.
Or more simply perhaps,
plug in N = 59, G = 2 and X = .5 and you'll get 1005 for Y.
The equation is quadratic, in the variable N. You could simplify the right hand side if you see that it looks like a 2nd degree polynomial in the variable N of the form a + bn + cN².
Now.. this solves (at the moment), for Y.
To make it solve for N (how many gems you can get) in terms of Y, G, X - we'll have to take the quadratic equation, and "complete the square" in the variable N.
That's for another time..