Sum of First n Natural Numbers Calculator

Sum of First n Natural Numbers Calculator

Growing AI Skill PRO

Enter Calculation

Formula

S=n(n+1)2S = \frac{\text{n}\left(\text{n}+1\right)}{2}

Example

S=100·(100+1)2=5,050S = \frac{100 \cdot \left(100+1\right)}{2} = 5{,}050
Usage stats

Advertisement

Results

Sum of First n Natural Numbers
5,050
Number of terms (n) 100
Average of terms 50.5

Report an error on this page

What is this calculator?

The Sum of First n Natural Numbers Calculator adds together every whole number from 1 up to a value you choose, n. Instead of typing 1 + 2 + 3 + ... by hand, it uses the famous closed-form formula \(S = n(n+1)/2\) to return the answer instantly, no matter how large n is.

How to use it

Enter the number of terms, n (for example 100 to add 1 through 100), then read the result. The calculator also reports how many terms were summed and the average value of those terms, which equals \((n+1)/2\).

The formula explained

The sum of an arithmetic series with first term 1, last term n, and n terms is the number of terms multiplied by the average of the first and last term: $$S = n \times (1 + n) / 2.$$ This simplifies to \(n(n+1)/2\). The trick — pairing the first and last terms, second and second-to-last, and so on — is often credited to a young Carl Friedrich Gauss.

Advertisement
Two staircases of squares combine into an n by (n+1) rectangle
Pairing two triangular stacks forms an n by (n+1) rectangle, so the sum is half of n(n+1).

Worked example

For n = 100: $$S = 100 \times (100 + 1) / 2 = 100 \times 101 / 2 = 10100 / 2 = 5050.$$ The average term is \((100 + 1) / 2 = 50.5\).

Arrows pairing first and last terms of the sequence, each pair summing to n+1
Gauss's pairing: each pair of terms adds to n+1, giving n/2 pairs.

Sums for Common Values of n

The table applies \(S = \frac{n(n+1)}{2}\) to some common values of n. The average of the first n natural numbers is \(\frac{n+1}{2}\), which is the midpoint between the first term (1) and the last term (n).

n Sum \(\frac{n(n+1)}{2}\) Average \(\frac{n+1}{2}\)
10 55 5.5
50 1,275 25.5
100 5050 50.5
500 125,250 250.5
1000 500,500 500.5
10000 50,005,000 5,000.5

Example for n = 100: \(S = \frac{100 \times 101}{2} = \frac{10100}{2} = 5050\). The sum grows roughly with the square of n, because \(\frac{n(n+1)}{2} \approx \frac{n^2}{2}\) for large n. Multiplying n by 10 therefore multiplies the sum by about 100. Compare n = 100 (5,050) with n = 1000 (500,500).

Advertisement

Key Terms and Related Sums

  • Natural numbers: the counting numbers 1, 2, 3, … (some conventions also include 0, which does not change these sums).
  • Arithmetic series: the sum of terms in which each term differs from the previous one by a constant amount. The numbers 1 + 2 + … + n form an arithmetic series with common difference 1.
  • Partial sum: the sum of only the first n terms of a (possibly infinite) sequence. Here S is the nth partial sum of 1, 2, 3, …
  • Triangular number: the number \(T_n = \frac{n(n+1)}{2}\), so called because that many dots can be arranged in a triangle with n rows. For example, \(T_4 = 10\).
  • Closed-form formula: an expression that gives the result directly from n in a fixed number of operations, without adding the terms one by one.

Related formulas for the first n natural numbers:

  • Sum of the first n odd numbers: \(1 + 3 + 5 + \dots + (2n-1) = n^2\)
  • Sum of the first n even numbers: \(2 + 4 + \dots + 2n = n(n+1)\)
  • Sum of squares: \(1^2 + 2^2 + \dots + n^2 = \frac{n(n+1)(2n+1)}{6}\)
  • Sum of cubes: \(1^3 + 2^3 + \dots + n^3 = \left[\frac{n(n+1)}{2}\right]^2\), the square of the triangular number \(T_n\)

FAQ

Does this include 0? No. Natural numbers here start at 1, so the sum covers 1 through n.

Can n be a decimal? The formula works for any number, but a true count of natural numbers should be a positive whole number.

Why use the formula instead of adding? The formula runs in a single step even for n in the billions, while adding one at a time would take far longer.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators