- #1

Johnathanrs

- 1

- 0

n/2(f+l) = algorithm sum of all integers

n= number of all integers

f= first integer

l= last integer

Example: 1, 2, 3, 4

4/2(1+4)

2(5) = 10

I know how to do it, but I don't really understand how to actually do it. Am I just too stupid?

Why do I need to split the sum of all integers?

Why am I adding the first + last integer?

Why when I times them together does it work?

How did he create the algorithm for this?