# Computing closed form summations

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)

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$.
• I was referring to $(3i-1)$, as we work with $k$ index, $3i-1$ is being treated as a constant. I am not sure whether I am answering your latest question. Commented Mar 1, 2018 at 5:23