Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
It's a geometric series. – M.B. Dec 3 '13 at 10:45
Your formula above is not recursive... – Eleven-Eleven Dec 3 '13 at 10:53
Welcome to Math.SE (first post): I edited out "recursive" and made the title sensible. Given the programming aspect of the Q, it's possible the word "recursive" refers to a software concept, but is not mathematically sensible. – hardmath Dec 3 '13 at 11:15
@hardmath thanks. I had missed that concept (in programming and maths the recursive concept is different). – brunoais Dec 3 '13 at 12:35
up vote 4 down vote accepted


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$

share|cite|improve this answer
No problem :-) +1 (and removing the comments shortly) – Jyrki Lahtonen Dec 3 '13 at 11:17
AHA! That's what was missing for me! what you wrote in that second line was the thing I was not remembering. Thank you for the help! – brunoais Dec 3 '13 at 13:25
@ChistopherErnst Oh, by the way, $\frac{\ln(z-89)}{\ln(2)} = log_2(z-89)$ right? – brunoais Dec 3 '13 at 15:28
Yes, that is correct; $\frac{\ln(x)}{\ln(z)}=\log_z(x)$ – Eleven-Eleven Dec 3 '13 at 17:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.