Let $f(n) = \sum_{i=1}^{n} i\cdot(2^i)$ How to write $f(n)$ only in terms of $n$.
I am unable to find. Thanks in advance.
Let $f(n) = \sum_{i=1}^{n} i\cdot(2^i)$ How to write $f(n)$ only in terms of $n$.
I am unable to find. Thanks in advance.
Hint
Note that $$ \frac{x(1-x^n)}{1-x}=\sum_{i=1}^{n}x^i. $$ Hence $$ x\frac{d}{dx}\left(\frac{x(1-x^n)}{1-x}\right)=\sum_{i=1}^{n}ix^i $$ You should be able to take it from here.
An elementary approach based upon the geometric series summation formula is \begin{align*} \color{blue}{\sum_{i=1}^ni2^i}&=\sum_{i=1}^n\left(\sum_{j=1}^i1\right)2^i=\sum_{i=1}^n\sum_{j=1}^i2^i\tag{1}\\ &=\sum_{1\leq j\leq i\leq n}2^i\\ &=\sum_{j=1}^n\sum_{i=j}^n2^i=\sum_{j=1}^n\sum_{i=0}^{n-j}2^{i+j}\tag{2}\\ &=\sum_{j=1}^n2^j\sum_{i=0}^{n-j}2^{i}=\sum_{j=1}^n2^j\cdot\frac{2^{n-j+1}-1}{2-1}\tag{3}\\ &=\sum_{j=1}^n2^{n+1}-\sum_{j=1}^n2^j\tag{4}\\ &=n2^{n+1}-\left(\frac{2^{n+1}-1}{2-1}-1\right)\tag{5}\\ &\color{blue}{=2^{n+1}(n-1)+2}\tag{6} \end{align*}
Comment:
In (1) we represent the factor $i$ as sum.
In (2) we exchange the order of summation and shift the inner index $i$ to start from $i=0$.
In (3) we apply the geometric series summation formula to the inner sum.
In (4) we simplify and split the sum.
In (5) we calculate both sums by again applying the geometric series summation formula to the right-hand sum.
In (6) we do some final simplifications.