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?
 A: 
$$ 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)$$
A: Small additional info. The expression
$$ S_n = \sum_{k=0}^n \sum_{j=0}^{k-1} 3^k $$
has for $k=0$ an empty inner sum
\begin{align*}
\sum_{j=0}^{-1} 3^k=0
\end{align*}
since the upper limit of the sum is smaller than the lower limit.

So, we have effectively
  \begin{align*}
 \sum_{k=0}^n \sum_{j=0}^{k-1} 3^k&= \sum_{k=\color{blue}{1}}^n \sum_{j=0}^{k-1} 3^k=\sum_{k=0}^{n-1} \sum_{j=0}^{k} 3^{k+1}
\end{align*}
  with range
  \begin{align*}
0\leq j\leq k\leq n-1
\end{align*}

