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.
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\).
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).
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.