Sum of Integers


This will simply show how to sum all integers from 1 to n, let this be Sn

Take the expression
(x - 1)2 = x2 - 2x + 1
This can be re-arranged to
x2 - (x - 1)2 = 2x - 1
Now if we sum each side from 1 to n, all the terms on the left would cancel leaving just n2
n2 - (n - 1)2 + (n - 1)2 - (n - 2)2 + (n - 2)2 - (n - 3)2 + .......... + 1 - 0
Hence
n2 = 2Sn - n
Resulting in the expression
Sn = n/2 (n + 1)
Updated: 08/01/2024