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
= Exact Sum of integers
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
  1. n = 100
  2. Sum from 1 to n = 100 * (100 + 1) / 2 = 5050
  3. Sum of the squares = 100 * (100 + 1) * (2*100 + 1) / 6 = 338 350
  4. Sum of the cubes = (100 * (100 + 1) / 2)^2 = 25 502 500
  5. Sum of the first n odd numbers = 100^2 = 10 000
  6. 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

    Related calculators

    Settings

    Theme

    System follows your operating system and changes with it.

    Text size
    High contrast

    Maximises text and border contrast and removes the grid background.

    Graph-paper background

    Round to
    Notation
    Thousands separators
    Decimal mark
    Nearest fraction

    Shows the result as the nearest tape-measure fraction, with the error it costs.


    Accessibility & interaction
    Reduce motion Stops interface animations even when the operating system does not.
    Underline links Keeps links visually distinct without relying on colour.
    Larger touch targets Makes buttons and form controls easier to tap.
    Shorter reading lines Limits article width for easier scanning.
    Monochrome display Removes colour as an information cue.
    Always-visible focus Makes the keyboard focus ring persistent and stronger.
    Verbose screen-reader results Announces the complete conversion equation.
    Sticky action bars Keeps converter and calculator actions within reach.
    Select values on focus Replaces a value immediately when you start typing.
    Left-handed mobile layout Moves key mobile actions toward the left thumb.

    Your data

    Settings, recent conversions and favourites live in this browser only. Nothing is sent anywhere.

    Offline library