sum for i = 0 to n sum for j = i to n (j-i)