Infinite Geometric Series Issue i have came across a series, i am trying to find its sum knowing the fact that, if it converges and its common ratio ex. r is: -1 < r < 1, then i can use the specified formula $\frac{a}{1-r}$ , which specifically means first term of series over 1 minus common ratio
here is the series 
$\sum_{n=1}^{\infty}\frac{2n-1}{2^n}$
i manipulated it this way to prove its convergence: $\sum_{n=1}^{\infty}\frac{2n-1}{2^n}=\sum_{n=1}^{\infty}(2n-1)\frac{1}{2^n}=\sum_{n=1}^{\infty}(2n-1)\left(\frac{1}{2}\right)^n$
$\frac{a}{1-r}=\frac{\frac{1}{2}}{1-\frac{1}{2}}=\frac{\frac{1}{2}}{\frac{1}{2}}=1$
using it i get the result 1, which actually should be 3

$$\sum_{n=1}^{\infty}\frac{2n-1}{2^n}=\sum_{n=1}^{\infty}\frac{2n}{2^n}-\sum_{n=1}^{\infty}\frac{1}{2^n}=\sum_{n=1}^{\infty}\frac{n}{2^{n-1}}-1.$$
We use Maclaurin series for  function $\frac{1}{(1-x)}$
$$\frac{1}{1-x}=1+x+x^2+x^3+\dots = \sum_{n=0}^{\infty} x^{n}$$
Differentiating both sides of  this equation we get that
$$\frac{1}{(1-x)^2}=1+2x+3x^2+4x^3+\dots = \sum_{n=1}^{\infty}n x^{n-1}$$
if $x=\frac 12$ then $\sum_{n=1}^{\infty}n (\frac 12)^{n-1}=\frac{1}{(1-\frac 12)^2}=4$
$$\sum_{n=1}^{\infty}\frac{2n-1}{2^n}=\sum_{n=1}^{\infty}\frac{n}{2^{n-1}}-1=3$$
