How to solve for a limit of summation: $z = \sum_{i=0}^x ( 2^i ) + 90$

149 Views Asked by At

I have a summation formula that I have to solve for a program I'm making.

The formula is as follows:

$$z = \sum_{i=0}^x ( 2^i ) + 90$$

If I only know the $z$, how can I calculate the $x$ in this formula?
The first part is easy (subtract 90 from $z$), but I can't quite figure out the rest.

For the record, $z$ is always integer, and only integer operations are used in this formula.

1

There are 1 best solutions below

4
On BEST ANSWER

$z-90=\sum_{i=0}^{x}2^i=2^0+2^1+2^2+...+2^x$

but $\frac{x^n-1}{x-1}=\sum_{k=0}^{n-1}x^n$

Thus $z-90=\frac{2^{x+1}-1}{2-1}=2^{x+1}-1\rightarrow 2^{x+1}=z-89 \rightarrow x=\frac{\ln(z-89)}{\ln(2)}-1$