(1) n(n-1)/2 and n(n+1)/2 The formulas are used to compute the sum of consecutive integers, but they are applied in different contexts:

$$ n(n-1)/2 $$

$$ n(n+1)/2 $$

Use when calculating the sum of numbers from 0 to n−1.

Example: Sum = 0+1+2+3+4 = 10

(2)

Use when calculating the sum of numbers from 1 to n.

Example: Sum = 1+2+3+4+5 = 15