<s>[INST] Proving $\frac1{2^1}+\frac2{2^2}+\cdots+\frac{n}{2^n}=2-\frac{n+2}{2^n}$ by induction I need to prove that
$$\frac1{2^1}+\frac2{2^2}+\cdots+\frac{n}{2^n}=2-\frac{n+2}{2^n}$$ by induction.
The base case was fine, and after that we have the induction hypothesis:
$$\frac1{2^1}+\frac2{2^2}+\cdots+\frac{k}{2^k}=2-\frac{k+2}{2^k} \tag1$$
holds for any given $n=k$.
The induction step is where I get stuck. We have
$$\frac1{2^1}+\frac2{2^2}+\cdots+\frac{k+1}{2^{k+1}} \tag2$$ and by the induction hypothesis we get
$$\begin{align}
2-\frac{k+2}{2^{k+1}} + \frac{k + 1}{2^{k+1}} &=2-\frac{2(k+2)}{2^{k+1}} +\frac{k+1}{2^{k+1}} \tag3 \\[6pt]
&= 2- \frac{3k+5}{2^{k+1}} \tag4
\end{align}$$ I certainly have made a mistake somewhere, but I can’t for the life of me figure out where.
 [/INST] Some simple mistake in your algebra. $-2(k+2)+k+1=-((k+1)+2)$.
</s>