# Simplify and determine a closed form for a nested summation

My task is to determine the closed form of this summation.

$${\sum_{k=0}^{n-1}{} } (\sum_{j=0}^{n^3-1}{j } - \sum_{j=0}^{n^2-1}{7k})$$

I am unsure whether it is appropriate to apply Gauss's identity and similar identities to simplify the terms within the nested summation since they are not strictly of the form specified.

For example, Gauss's identity:

$${\sum_{i=0}^{n-1}{i} }$$

with the upper limit only being decremented by one, and the variables in the expression being summed and the lower limit matching. Is it appropriate to simply substitute $n^2$ for $n$? Does the fact that the lower limit and the expression do not match matter?

Sorry if these are simple questions. I have not worked with summations very much and the extension of these identities do not seem clear to me.

• 1-Yes!, you can just substitute "$n^2-1$" or $n^3-1$ in the place of "$n$" in the general formula "$n(n+1)/2$ :) 2-The lower limit "j=0" or "j=1" take to the same result because when $j=0$ we sum one term $0$, that doesn't change the sum (it's the neutral element of the sum ) – Renji Rodrigo Jan 24 '18 at 11:05

• Note that: $$\sum_{j=0}^{n^3-1}j = 0+1+ \ldots +(n^3-1) = \frac{n^3(n^3-1)}2$$

• Also note that: $$\sum_{j=0}^{n^2-1}7k = \underbrace{7k+ 7k\ldots 7k}_{n^2\text{ times}}=7n^2k$$

• Thus, $$\sum_{k=0}^{n-1}\left[\frac{n^3(n^3-1)}2 - 7n^2k\right]$$ $$= \frac{n^3(n^3-1)}2\times n - 7n^2\left[0+1+\ldots +(n-1)\right]$$ $$= \frac{n^4(n^3-1)}2-\frac{7n^3(n-1)}2$$

You can substitute $n^2$ for $n$ for $\sum j$, and for the $\sum 7k$ since the index of summing is $j$ rather than $k$ you can just treat it as a constant.

$$\sum_{k=0}^{n-1}\left(\sum_{j=0}^{n^3-1}j - \sum_{j=0}^{n^2-1}7k\right)=\sum_{k=0}^{n-1}\left[\frac{n^3(n^3-1)}2-7kn^2\right]$$

Now once again since the first term does not contain $k$ we can treat it as a constant and move it out of the sum. The same for the $n^2$ in the second term.

$$\sum_{k=0}^{n-1}\left[\frac{n^3(n^3-1)}2-7kn^2\right]=\frac{n^4(n^3-1)}2-7n^2\frac{n(n-1)}2,$$

which you can further rearrange by yourself.

\begin{align} {\sum_{k=0}^{n-1}{} } \left( \sum_{j=0}^{n^3-1}{j } -\sum_{j=0}^{n^2-1}{7k} \right) =& {\sum_{k=0}^{n-1}{} } \left( \sum_{j=0}^{n^3-1}{j}-(n^2)(7k) \right) \\ =& {\sum_{k=0}^{n-1}{} } \left( \frac{(n^3-1+1)(n^3-1)}{2}-(n^2)(7k) \right) \\ =& \left( \frac{(n^3-1+1)(n^3-1)n}{2}-(n^2-1)\cdot 7\cdot \frac{(n-1)(n-1+1)}{2} \right) \\ =& \left( \frac{n^4(n^3-1)}{2}-\frac{7(n^4)(n-1)}{2} \right) \end{align}