Need a generalized way to solve $127=1+2+2^2+...$ How can I solve this equation generally? I can solve it by checking in my calculator. But I don't know any generalized way.
$$127=1+2+2^2+2^3+....+ 2^{x-1}$$
 A: Let $S=1+2+2^2+2^3+....+ 2^{x-1}$, then $2S=2+2^2+2^3+....+ 2^{x}$. So $2S-S=S=2^{x}-1$. Can you take it from here?
A: The most intuitive way:
\begin{align*}
&\;\underbrace{1 + 1} +2+2^2+2^3+ \cdots + 2^{x-1} \\
&= \underbrace{2 + 2} + 2^2 + 2^3 + \cdots + 2^{x-1} \\
&\;\;\;= \underbrace{4 + 2^2} + 2^3 + \cdots + 2^{x-1} \\
& \; \\ & \; \\ %vertical space
&\quad \quad\quad \quad\quad \; \; \; \; \; \cdots \\
& \; \\ & \; \\ %vertical space
&\quad \quad \quad \quad = \underbrace{2^{x-1} + 2^{x-1}} \\
&\quad \quad \quad \quad \quad \quad = 2^x \\
\end{align*}
Hence,
$$
1 + 2 + 2^2 + 2^3 + \cdots + 2^{x-1} = 2^x - 1.
$$
A: Prerequisites
Expanding $(\alpha^0+\alpha^1+...+\alpha^{n-1})\cdot(\alpha-1)$ in a clever way yields
$$
\alpha\cdot(\alpha^0+\alpha^1+...+\alpha^{n-1})-1\cdot(\alpha^0+\alpha^1+...+\alpha^{n-1})
$$
where the trained eye sees that everything but $\alpha^n$ from the first product and $-1$ from the second cancels. Thus it follows (dividing by $\alpha-1$) that
$$
(\alpha^0+\alpha^1+...+\alpha^{n-1})=\frac{\alpha^n-1}{\alpha-1}
$$
which is probably found in your book under the subject of geometric series.
Solution
Applying the above with $\alpha=2$ shows that
$$
f(x)=1+2+2^2+...+2^{x-1}=\frac{2^x-1}{2-1}=2^x-1
$$
so to solve $f(x)=127$ we have $2^x=128\iff x=\frac{\log(128)}{\log(2)}=7$.
A: Hint: $127=a\cdot \dfrac{r^{\text{number of terms}}-1}{r-1}$, where $a=$starting term, $r=$common ratio
