This comes from a coding problem on leetcode where Big O notation is being calculated. I'm trying to understand how the left side becomes the right side here:
$\displaystyle\sum_{i=0}^{n-1} {\sum_{j=i+1}^n} (j-i) = \sum_{i=0}^{n-1} \frac{(1+n-i)(n-i)}{2} $
Unfortunately it has been a long time since I've taken a math class, and I'm not even sure how to google this. Specifically, how does the inner summation on the left become $ \frac{(1+n-i)(n-i)}{2} $?