\sum _{k=0}^{m+1} ((m-k)(n-k))=-\frac{1}{6} (2+m)\left(m^2-2 m+3 n-3 m n-3\right)