Talk:Introduction-TADM2E
From Algorithm Wiki
TADM2E 1.10
First we'll verify the base case for $ n = 1 $ :
- $ \sum_{i=1}^1 i = \frac{1(1+1)}{2} = 1 $
Now, we'll assume given statement is true up to $ n - 1 $.
So,
- $ \sum_{i=1}^{n-1} i = \frac{(n-1)(n-1+1)}{2} = \frac{(n-1)n}{2} $
To prove for the general case $ n $,
- $ \sum_{i=1}^n i = \sum_{i=1}^{n-1} i + n = \frac{(n-1)n}{2} + n = \frac{n^2 - n + 2n}{2} = \frac{n^2 + n}{2} = \frac{n(n+1)}{2} $