$ \sum_{i=0}^{n-2}\left(\sum_{j=i+1}^{n-1} i\right) $
Formulas in my book give me equations to memorize and solve simple questions like $ \sum_{i=0}^{n} i $ ... However, For the question on top, how would I go about solving it by hand without a calculator? WolfRamAlpha seems to give the equation of 1/6[(n-2)(n-1)n].
Any suggestions would be appreciated. It's not a homework question, but I am studying for a test. I wrote the mathematical version of two nested for-loops for code that checks to see if a number in an array is unique or not.
Thank you.