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?

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*}

