add numbers in numerical order to a total based on how many times indicated:

31 Views Asked by At

Starting at 1, I would like to add the next numerical ordered number to the total. I would like to do the following in one short math equation if possible, as well as pick the number of times the next numerical ordered number is added:

Example: If I wanted to have this happen 10 times.

1+2+3+4+5+6+7+8+9+10=55

I would like to pick a random number like 354 and it must start at 1, and add the next numerically ordered number 354 times.

I hope there is an answer for this one. Thanks in advance. =)

2

There are 2 best solutions below

1
On BEST ANSWER

In sigma notation, you are calculating $\displaystyle\sum_{i=1}^n i$, which can be proven to be equivalent to the formula $\frac{n(n+1)}{2}$. If you are not familiar with sigma notation this means you start at $i=1$ and add the terms until you get to $n$, incrementing $i$ by 1 each time.

$$ \sum_{i=1}^n i = 1 + 2 + 3 + \cdots + n $$

0
On

How about this:

$1+2+3+4+5+...+(x-2)+(x-1)+x$ ($x$ numbers in total)

$=x+1+(x-1+2)+(x-2+3)+(x-3+4)+...$ (group numbers at the start and numbers at the end in pairs)

$=\frac{(x+1)x}{2}$ (because there are $\frac{x}{2}$ pairs of numbers).

You should be able to solve the equation.