Sum of consecutive integers calculator
Gauss famously added 1 to 100 in his head. These are the closed forms that make it possible.
Sum from 1 to n
5050
- Sum of the squares
- 338 350
- Sum of the cubes
- 25 502 500
- Sum of the first n odd numbers
- 10 000
- Sum of the first n even numbers
- 10 100
Show the working
- n = 100
- Sum from 1 to n = 100 * (100 + 1) / 2 = 5050
- Sum of the squares = 100 * (100 + 1) * (2*100 + 1) / 6 = 338 350
- Sum of the cubes = (100 * (100 + 1) / 2)^2 = 25 502 500
- Sum of the first n odd numbers = 100^2 = 10 000
- Sum of the first n even numbers = 100 * (100 + 1) = 10 100
Values are shown to six significant figures here; the arithmetic itself runs on exact fractions and is only rounded where a number is printed.
Scenarios & local history
Compare a saved scenario
Recent calculations
The formula
- sum = n(n+1)/2
- sum of squares = n(n+1)(2n+1)/6
- sum of cubes = (n(n+1)/2)^2, which is the square of the plain sum