To complete the above answers, you prove the formula (the sample is for a positive integer, but the principle is the same for negatives or any arithmetic set, as Void pointed out).
Just write the package two times below and add the numbers:
1+ 2+ 3+ ... n-2+ n-1+ n = sum(1..n) : n terms from 1 to n + n+ n-1+ n-2+ ... 3+ 2+ 1 = sum(n..1) : the same n terms in reverse order -------------------------------- n+1+ n+1+ n+1+ ... n+1+ n+1+ n+1 = 2 * sum(1..n) : n times n+1 n * (n+1) / 2 = sum(1..n)
kriss source share