Calculate

$$
\sum_{p=0}^{n} \sum_{q=0}^{p} p+q
$$
We change the order of the sum. Let's group the terms for which $p+q$ is constant. Let $i=p+q$, then we have:

$$
\begin{aligned}
& \sum_{p=0}^{n} \sum_{q=0}^{p} p+q=\sum_{i=0}^{n} \sum_{k=0}^{i+1} i=\sum_{i=0}^{n} i(i+1)=\sum_{i=0}^{n} i^{2}+\sum_{i=0}^{n} i \\
& =\frac{n(n+1)(2 n+1)}{6}+\frac{n(n+1)}{2}=\frac{n(n+1)(2 n+4)}{6}
\end{aligned}
$$