Find $S=\frac{1}{2}+\frac{3}{2^2}+\frac{5}{2^3}+\frac{7}{2^4}+...+\frac{2n-1}{2^n}+...$ I'm trying to calculate $S$ where $$S=\frac{1}{2}+\frac{3}{2^2}+\frac{5}{2^3}+\frac{7}{2^4}+...+\frac{2n-1}{2^n}+...$$
I know that the answer is $3$, and I also know "the idea" of how to get to the desired outcome, but I can't seem to actually go through with the proof.
The idea for solving this question is: First we will only work on the partial sum $S_n$ and once we find a closed form for it, we will limit $n$ to $\infty$ to find our answer. Notice that for example $\frac{3}{2^2}$ can be rewritten as $\frac{1}{2^2}+\frac{2}{2^2}$, knowing this, we can write $S_n$ a bit differently:
$$S_n=(\frac{1}{2}+\frac{1}{2^2}+\frac{1}{2^3}+\frac{1}{2^4}+...+\frac{1}{2^n})+\frac{2}{2^2}+\frac{4}{2^3}+\frac{6}{2^4}+...+\frac{2n-2}{2^n}$$
Notice that the part in the brackets is a finite sum that we can calculate, we know it converges to $1$ when $n$ approaches $\infty$
And now we can repeat the process again for what's not in the brackets and we can repeat this an infinite amount of times.
And if we keep going like that, we will indeed see that the sequence of whats in the bracket is: $1,1,\frac{1}{2},\frac{1}{4},\frac{1}{8}...$ and if we sum them all up it will converge to the desired outcome which is $3$.
And that is exactly what I am having problems showing, that the sequence of whats in the brackets at each step is $\frac{1}{2^k}$.
I hope this was clear enough, it is a bit difficult to explain it, and my english is not perfect so I apologize in advance.

$$\sum_{n=1}^\infty\frac{2n-1}{2^n}=\sum_{n=1}^\infty\frac n{2^{n-1}}-\sum_{n=1}^\infty\frac1{2^n}=\frac1{\left(\frac12\right)^2}-\frac{\frac12}{1-\frac12}=4-1=3$$
The above follows from
$$|x|<1\implies\frac1{1-x}=\sum_{n=0}^\infty x^n\;,\;\;\left(\frac1{1-x}\right)'=\sum_{n=1}^\infty nx^{n-1}$$
and the splitting of the first sum in the first line above is justified as both series in the right converge.
