How to work out a double summation without manually finding each answer? I have the double summation
$$
\sum_{p = 1}^{2} \sum_{q = p}^{3} {(p-1)q}
$$
I know how to work this out if I was to go through and add up every term. My question is, how would I do this in a shorter way, so if the 2 and the 3 were 200 and 300, I could still do it just as easily. Examples I have found don't have the "q = p" on the 2nd summation and this is what I think is throwing me off.  Could anyone explain how to do this?
Thanks
 A: The easiest way is to note that the $p-1$ factor does not depend on $q,$ so that $$\sum_{p=1}^2\sum_{q=p}^3(p-1)q=\sum_{p=1}^2(p-1)\sum_{q=p}^3q.$$ The second sum is the same as adding up the first $3$ positive integers, then subtracting the first $p-1$ of them. In general, the formula for the sum of the first $n$ positive integers is $$\sum_{q=1}^nq=\frac{n(n+1)}2,$$ so the sum of the first $3$ is $6$, and the sum of the first $p-1$ is $\frac{(p-1)p}2.$ Thus, $$\sum_{q=p}^3q=6-\frac{(p-1)p}2=\frac{12}2+\frac{-p^2+p}2=\frac{-p^2+p+12}2,$$ and so our nested sum becomes $$-\frac12\sum_{p=1}^2(p-1)(p^2-p-12).$$ Finally, noting that the summand is $0$ when $p=1$ due to the factor $p-1,$ our nested sum becomes $$-\frac12\sum_{p=2}^2(p-1)(p^2-p-12)=-\frac12(2-1)(2^2-2-12)=-\frac12\cdot1\cdot-10=5.$$ Had we been dealing with a larger number than $2,$ we'd have wanted to expand $(p-1)(p^2-p-12)=p^3-2p^2-11p+12,$ then use formulas for sums of the first $n$ cubes, squares, positive numbers, and sums of constants to get the final answer.
A: You may know that $$\sum_{q=1}^m q=\frac{m(m+1)}{2}.$$
Therefore,
$$\sum_{q=p}^m q=\sum_{q=1}^m q-\sum_{q=1}^{p-1} q=\frac{m(m+1)}{2}-\frac{p(p-1)}{2}.$$
Now using similar well-known formulas for $\sum p^2$ and $\sum p^3$
$$\begin{align} \sum_{p=1}^n\sum_{q=p}^m(p-1)q &= \sum_{p=1}^n(p-1)\sum_{q=p}^mq \\
&= \sum_{p=1}^n(p-1)\left(\frac{m(m+1)}{2}-\frac{p(p-1)}{2}\right)\\
&= \frac{m(m+1)}{2}\sum_{p=1}^n(p-1)-\sum_{p=1}^n\frac{p(p-1)^2}{2}\\
&= \frac{m(m+1)}{2}\cdot\frac{n(n-1)}{2}-\frac12\sum_{p=1}^np^3+\sum_{p=1}^np^2-\frac12\sum_{p=1}^np\\
&=\frac{mn(m+1)(n-1)}4-\frac{n^2(n+1)^2}8+\frac{n(n+1)(2n+1)}6-\frac{n(n+1)}{4}\\
&=\frac{mn(m+1)(n-1)}4-\frac{n(n-1)(n+1)(3n-2)}{24}\\
&=\frac{n(n-1)}{24}\bigl(m(m+1)-(n+1)(3n-2)\bigr)
\end{align}$$
It's no surprise that this is a multiple of $n(n-1)$, is it?
