Ma · Mathematics

Factorial, but with Addition

Published By the 9to5Science editorial team

At a glance

  1. 1. List the terms

    Replace the product 1 × 2 × … × n with the sum 1 + 2 + … + n.

  2. 2. Use the formula

    For a positive integer n, the sum is n(n + 1)/2, called the nth triangular number.

  3. 3. Check the result

    For example, adding 1 through 8 gives 8 × 9 / 2 = 36.

A factorial multiplies consecutive positive integers: for a positive integer nn, n!=1⋅2⋅3⋯nn! = 1\cdot 2\cdot 3\cdots n. If you replace multiplication with addition, the usual interpretation is to add those same integers instead:

1+2+3+⋯+n.1+2+3+\cdots+n.

That sum is the nth triangular number, with formula n(n+1)/2n(n+1)/2. There is no universally standard notation called “addition factorial,” so it helps to write out the terms you mean. The formula below applies when the terms are the integers from 1 through a positive integer nn.

Why the sum is n(n+1)/2n(n+1)/2

Let

S=1+2+3+⋯+(n−1)+n.S=1+2+3+\cdots+(n-1)+n.

Write the same sum in reverse order and add the two lines term by term:

S=1+2+3+⋯+(n−1)+n,S=n+(n−1)+(n−2)+⋯+2+1.\begin{aligned} S &= 1+2+3+\cdots+(n-1)+n,\\ S &= n+(n-1)+(n-2)+\cdots+2+1. \end{aligned}

Each pair of terms in a column adds to n+1n+1, and there are nn columns. So 2S=n(n+1)2S=n(n+1), which gives

S=n(n+1)2.S=\frac{n(n+1)}{2}.

The result is always an integer: one of two consecutive integers, nn or n+1n+1, must be even.

Worked example: adding from 1 to 8

The sum is

1+2+3+4+5+6+7+8.1+2+3+4+5+6+7+8.

Using the formula with n=8n=8 gives

8(8+1)2=8⋅92=36.\frac{8(8+1)}{2}=\frac{8\cdot 9}{2}=36.

You can check by pairing the ends: 1+8=91+8=9, 2+7=92+7=9, 3+6=93+6=9, and 4+5=94+5=9. There are four pairs, each totaling 9, so the sum is 4⋅9=364\cdot 9=36.

For comparison, 8!8! is a product, not this sum:

8!=1⋅2⋅3⋅4⋅5⋅6⋅7⋅8=40,320.8!=1\cdot2\cdot3\cdot4\cdot5\cdot6\cdot7\cdot8=40{,}320.

If you meant a different sum

Two expressions that sound similar are often confused:

  • Adding the integers through nn: 1+2+⋯+n=n(n+1)21+2+\cdots+n=\frac{n(n+1)}{2}.
  • Adding the factorials through nn: 1!+2!+⋯+n!1!+2!+\cdots+n!.

The second expression is a sum of factorial values, not a factorial with addition replacing multiplication. For example, when n=4n=4, it is 1!+2!+3!+4!=1+2+6+24=331!+2!+3!+4!=1+2+6+24=33. The triangular-number formula does not apply to that sum.

You might also want to start at a number other than 1. For integers aa and bb with a≤ba\le b, the consecutive integers from aa through bb, inclusive, number b−a+1b-a+1. Their sum is

(a+b)(b−a+1)2.\frac{(a+b)(b-a+1)}{2}.

For instance, 4+5+6+7+84+5+6+7+8 has five terms, so its sum is (4+8)⋅5/2=30(4+8)\cdot5/2=30.

Common mistakes

  • Using the factorial symbol for the sum: By convention, n!n! means multiplication. Write the additions explicitly or call the result a triangular number.
  • Leaving out an endpoint: The formula n(n+1)/2n(n+1)/2 includes both 1 and nn. If the sum starts at 0, that extra term is zero, so the value is unchanged; if it starts at 2, subtract 1 from the formula.
  • Using the wrong consecutive-integer formula: The sum from 1 to nn is n(n+1)/2n(n+1)/2, not n(n−1)/2n(n-1)/2. The latter is the sum from 1 to n−1n-1.
  • Applying it to factorial values: 1!+2!+⋯+n!1!+2!+\cdots+n! adds products, so it is a different calculation.

If your intended expression is “nn plus every integer below it down to 1,” the triangular-number formula gives the answer directly.

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.