Sum of First n Integers
Closed form for the sum of the first n natural numbers.
Live Calculator
MembersVariables
Example
1 + 2 + … + 100 = 100·101/2 = 5050 (as young Gauss famously found).
How it works
This formula gives the total when you add the counting numbers from 1 up to n without writing them all out. It works because the list can be paired from the ends: 1 with n, 2 with n-1, and so on, and each pair has the same sum, n+1. There are n/2 such pairs, so the total is n(n+1)/2.
When to use it
Use this when you need the sum of a consecutive run of whole numbers, such as counting objects in rows, finding the total of the first n terms of a simple counting pattern, or checking arithmetic-series sums quickly. It is especially useful in combinatorics, number theory, and mental math.
Worked example, step by step
Find 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 Use the formula: n(n+1)/2 Substitute n = 8: 8(8+1)/2 Simplify: 8·9/2 Compute: 72/2 = 36 So, 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 = 36
Common mistakes to avoid
- Using n instead of n+1 in the formula
- Forgetting that the formula applies to consecutive integers starting at 1
- Multiplying by n/2 incorrectly when n is odd without understanding that the final formula still gives an integer
Did You Know?
Gauss allegedly found this formula as a schoolboy to sum 1 through 100 in seconds.
Share this formula
More in Number Theory
View allEuclidean Algorithm
BasicRecursively finds the greatest common divisor.
Modular Congruence
Basica and b have the same remainder when divided by m.
Fermat's Little Theorem
AdvancedHolds when p is prime and gcd(a,p)=1.
Euler's Totient
AdvancedCounts integers up to n coprime to n.
Prime Number Theorem
AdvancedApproximates the number of primes below x.
LCM from GCD
BasicLeast common multiple via the greatest common divisor.