0

I'm doing a programming tutorial and an algorithm to sum each number up to N can also be done by the below formula. E.g. if n = 10, 1+2..+10 = 55.

Forgive me for the stupid question :) but why does the formula use the sigma notation? Could we not use this formula without the summation and get the same result?

$\sum_{i=1}^n$$i= \frac{(n)(n+1)}{2}$

0xgareth
  • 103

1 Answers1

0

Note that $$1+2+\dots + n = \sum_{i=1}^n i = \frac{n(n+1)}{2}$$ So, both notations are identical.

VIVID
  • 11,604