Please help to solve:
$\sum_{k=1}^{n}\left (2k-1\right )/2^k$ I tried to separate the numerator into $2k$ and $-1$, and the second fraction is easy to calculate. But I can't get sum for the first one.
I know the answer $3-(2n+3)/2^n$ , but can't get a solution.
Firstly,
$$\sum_{k=1}^n\ \frac k{2^k}=\sum_{k=1}^n\ \left(\frac k{2^{k-1}}-\frac {k+1}{2^k}+\frac 1{2^k}\right)=1-\frac {n+1}{2^n}+\sum_{k=1}^n\ \frac 1{2^k}=2-\frac {n+2}{2^n}$$
So the required sum is:
$$\sum_{k=1}^n \frac{2k-1}{2^{k}} = 2\sum_{k=1}^n \frac{k}{2^{k}}-\sum_{k=1}^{n}\frac{1}{2^k}=4-\frac{2n+4}{2^{n}}-\left(1-\frac{1}{2^n}\right)=3-\frac{2n+3}{2^n}$$