Sum of Integers, Squares & Series Calculator

Free sum of integers calculator: add 1 to n, any range, squares, cubes or any power, odd or even numbers, multiples, arithmetic and geometric series, Fibonacci numbers, or Σ of your own formula. Exact answers for huge numbers with the formula and worked steps.

Sum
–

Sums of integers, squares, cubes and more

This calculator adds up numbers in the ways students and programmers need most, exactly: with arbitrarily large integers, so even the sum of the first 10²⁰ squares comes out with every digit right. It shows the formula it used, a worked example with your numbers and, for small cases, every term with its running total.

The formulas

Natural numbers1 + 2 + … + nn(n+1)/2
Squares1² + 2² + … + n²n(n+1)(2n+1)/6
Cubes1³ + 2³ + … + n³[n(n+1)/2]²
Odd numbers1 + 3 + … + (2n−1)n²
Even numbers2 + 4 + … + 2nn(n+1)
Arithmetic seriesa + (a+d) + … (n terms)n(2a + (n−1)d)/2
Geometric seriesa + ar + … + arⁿ⁻¹a(1−rⁿ)/(1−r), or a/(1−r) forever when |r| < 1
Fibonacci numbersF₁ + F₂ + … + FₙFₙ₊₂ − 1

The story goes that the young Gauss added 1 to 100 in seconds by pairing 1 with 100, 2 with 99 and so on: fifty pairs each worth 101, giving 5,050. Every formula above can be proved by induction. For higher powers (fourth, fifth, up to the 60th) the calculator uses Faulhaber's formula, built from Bernoulli numbers, which gives an exact integer for any n.

Questions people ask

  • How do I find the sum of integers from 5 to 20? Use Any range: it adds every integer between the two ends, negative numbers included. It is (first + last) × (count) ÷ 2.
  • What is the sum of multiples of 3 or 5 below 1000? Use Multiples. It adds multiples of 3 and of 5 and subtracts the multiples of 15 counted twice: 233,168 (the first Project Euler problem).
  • Can I sum my own formula? Yes, Σ your formula adds any expression in i, such as 1/i^2 or i^2 + 3i, for up to five million terms.
  • Why is the sum of the first n odd numbers n²? Each new odd number wraps an extra L-shaped border around a square of dots, turning an n × n square into (n+1) × (n+1).

Related: Calculator · CAS Calculator · More calculators

Comments
Advertisement