0
$\begingroup$

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}$

$\endgroup$
1
  • $\begingroup$ Welcome to MSE. Will you please rephrase your question? I simply have no idea about what you are asking. $\endgroup$ Jan 5, 2021 at 9:23

1 Answer 1

0
$\begingroup$

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

$\endgroup$
1
  • $\begingroup$ thanks for the answer :) $\endgroup$
    – 0xgareth
    Jan 5, 2021 at 9:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .