sum (a(k) - a(k+1)) from k = 1 to n