I wanted to solve the following recurrence relation: $$f(0) = 0$$ $$f(n+1) = f(n) + \frac{1}{2^n}$$
By looking at a few values I came up with: $$f(n) = 2 - 2^{1-n}$$ which I could prove by mathematical induction.
But is there a way to solve this without guessing and then proving by induction?
You have $f(n)-f(n-1)=\dfrac1{2^{n-1}}$ for $n\ge 1$, so
$$\begin{align*} \sum_{k=1}^n\big(f(n)-f(n-1)\big)&=\sum_{k=1}^n\frac1{2^{k-1}}\\ &=\sum_{k=0}^{n-1}\frac1{2^k}\\ &=\sum_{k=0}^{n-1}\left(\frac12\right)^k\\ &=\frac{1-\left(\frac12\right)^n}{1-\frac12}\\ &=2-\frac1{2^{n-1}}\;. \end{align*}$$
But the initial sum telescopes:
$$\begin{align*} \sum_{k=1}^n\big(f(n)-f(n-1)\big)&=\sum_{k=1}^nf(n)-\sum_{k=1}^nf(n-1)\\ &=\sum_{k=1}^nf(n)-\sum_{k=0}^{n-1}f(n)\\ &=f(n)-f(0)\\ &=f(n)\;. \end{align*}$$
Thus, $f(n)=2-\dfrac1{2^{n-1}}$.
This is really just a rigorous way to show that $f(n)$ is the sum of the fractions $\frac1{2^k}$ for $0\le k<n$, something that is fairly apparent from the recurrence itself.