$$\sum_{k=1}^{7}40 \left( \frac{1}{2}\right)^{k-1} = \frac{635}{8}$$
The image of the orginial eqn is on the link above and so is the answer, but I need help in how to solve it. when I did solve it I got $$\displaystyle 5(\frac{127}{8})$$
What did I do wrong? when solving: $$r=1/2$$ $$Ag=40$$ $$n=7$$ So I plugged in everything into the formula: $$\begin{align} \sum &=Ag \frac{1-r^n}{1-r}\\ &= 40 \frac{1-(1/2)^7}{1-1/2}\\ &=40\frac{1-1/128}{2/2-1/2}\\ &=49\frac{128/128-1/128}{1/2}\\ &=40\frac{127/128}{1/2}\\ &=40\frac{127}{128}\cdot\frac21\\ &=40\frac{127}{64}\cdot 1\\ &=5\frac{127}8\end{align}$$
You asked specifically about your mistake. The glaring error is that $\displaystyle \frac{128}{2} = 64$, not $16$ (in the cancellation step).
But this may have been a typo, because your final answer is actually correct. $\displaystyle 5(\frac{127}{8}) = \frac{635}{8}$.