Problem:
Compute the close form for $\sum_{i=1}^n \sum_{j=1}^n \sum_{k=1}^n (3i-1)$ as a polynomial in n. The closed form solution should not have a summation in it.
I am not used to working with multiple summations so I'm not sure if I erred in my process or if this is the correct solution:
$\sum_{i=1}^n \sum_{j=1}^n (3\sum_{k=1}^ni-1\sum_{k=1}^n)$
$\sum_{i=1}^n \sum_{j=1}^n (3(1/2n^2 + 1/2 n)- n)$
$\sum_{i=1}^n \sum_{j=1}^n (3/2n^2 + 3/2 n- n)$
$\sum_{i=1}^n (3/2\sum_{j=1}^nn^2 + 3/2 \sum_{j=1}^nn- \sum_{j=1}^nn)$
$\sum_{i=1}^n (3n^3 + 3/2 n^2- n^2)$
(3$\sum_{i=1}^nn^3 + 1/2 \sum_{i=1}^nn^2)$
(3n^4 + 1/2n^3)
\begin{align}\sum_{i=1}^n \sum_{j=1}^n \sum_{k=1}^n (3i-1) &= \sum_{i=1}^n (3i-1)\left[\sum_{j=1}^n \sum_{k=1}^n 1\right]\\ &=n^2\sum_{i=1}^n (3i-1)\end{align}
Can you finish off the problem?
Remark:
As you work on summation over the $k$ index, notice that the expression that is being worked on is independent of $k$. Index $k$ shouldn't influence index $i$.
Remark: Another mistake is one of the $\frac32$ become $3$.