Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Sum of First n Natural Numbers
5,050
S = n(n+1)/2
Number of terms (n) 100
Average of terms 50.5

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.

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: