I'm currently taking a discrete mathematics course, and we're learning about summation formulas. I need to create a formula for the nested summation
$$ \sum_{i=0}^{n} \sum_{j=0}^i 2^i $$
I started with the inner summation:
$$ \sum_{j=0}^{i} 2^i $$
and arrived at
$$ 2^{i+1} - 1 $$
I plugged this into the outer summation
$$ \sum_{i=0}^{n} 2^{i+1}-1 $$
The following is my work for evaluating the outer sum:
$$ \sum_{i=0}^{n} 2^{i+1}- \sum_{i=0}^{n}1 = 2(\sum_{i=0}^{n} 2^{i})- n = 2(2^{n+1} - 1) - n = 2^{n+2} - 2 - n $$
So my final answer is $\ 2^{n+2}-2-n$. However, when I checked my answer on Wolfram Alpha, it says my answer should be $\ 2^{n+1}(n+1)$ check here Wolfram source. Can someone please explain how I am supposed to arrive at what Wolfram Alpha is saying and point out where I went wrong with my computation? Thank you!