Evaluating a finite sum using a double sum I want to evaluate the sum $S_n = \sum_{k=0}^n k 3^k $.
Try:
Since $ \sum_{j=0}^{k-1} 1 = k $, then
$$ S_n = \sum_{k=0}^n \sum_{j=0}^{k-1} 3^k $$
Since we are summing over $(0 \leq k \leq n )$ and $(0 \leq j \leq k -1 )$, then we are summing over $(0 \leq j < k \leq n )$. Thus, we can write
$$ S_n = \sum_{j=0}^n \sum_{k=j}^n 3^k = \sum_{j=1}^n \frac{ 3^{n+1} - 3^j }{2} = \frac{n 3^{n+1}}{2} - \frac{1}{2} \sum_{j=0}^n 3^j = \boxed {\frac{n 3^{n+1} }{2} - \frac{1}{2} \cdot \left( \frac{ 3^{n+1} - 1 }{2} \right) } $$
Is this a correct argument?


$$ S_n = \sum_{j=0}^n \sum_{k=j}^n 3^k = \sum_{j=1}^n \frac{ 3^{n+1} - 3^j }{2} = \frac{n 3^{n+1}}{2} - \frac{1}{2} \sum_{j=0}^n 3^j = \boxed {\frac{n 3^{n+1} }{2} - \frac{1}{2} \cdot \left( \frac{ 3^{n+1} - 1 }{2} \right) } $$
Is this a correct argument?

You have an error.
Since $j\le k-1\iff k\ge j+1$, we have
$$\small S_n = \sum_{j=0}^n \sum_{k=\color{red}{j+1}}^n 3^k=\sum_{j=0}^{n}\frac{3^{n+1}-3^{j+1}}{2}=\frac{(n+1)\cdot 3^{n+1}}{2}-\frac 12\sum_{j=0}^{n}3^{j+1}=\frac{(n+1)\cdot 3^{n+1}}{2}-\frac 12\left(\frac{3^{n+2}-3}{2}\right)$$
