Arithmetic Series Sum Calculator Formula

Understand the math behind the arithmetic series sum calculator. Each variable explained with a worked example.

Formulas Used

Num Terms

num_terms = floor((end_val - start_val) / step_val) + 1

Sum Val

sum_val = (floor((end_val - start_val) / step_val) + 1) / 2 * (start_val + start_val + floor((end_val - start_val) / step_val) * step_val)

Average Val

average_val = (start_val + start_val + floor((end_val - start_val) / step_val) * step_val) / 2

Variables

VariableDescriptionDefault
start_valStart Value1
end_valEnd Value100
step_valStep1

How It Works

Arithmetic Series Sum

Formula (Gauss's Method)

Sum = n/2 × (first + last)

where n is the number of terms.

Famous Example

Gauss reportedly summed 1 to 100 as a child: Sum = 100/2 × (1 + 100) = 50 × 101 = 5050.

General Formula

For a series from a to b with step d:

  • Number of terms: floor((b - a) / d) + 1
  • Sum = n/2 × (first + last)
  • Worked Example

    Sum all integers from 1 to 100.

    start_val = 1end_val = 100step_val = 1
    1. 01Number of terms = 100
    2. 02Sum = 100/2 × (1 + 100)
    3. 03= 50 × 101
    4. 04= 5050

    Frequently Asked Questions

    Who discovered this formula?

    The formula is often attributed to young Carl Friedrich Gauss, who allegedly used it to quickly sum 1 to 100 as a schoolchild.

    Does this work for non-integer steps?

    Yes, the formula works for any arithmetic series regardless of step size, as long as the terms form a constant-difference sequence.

    What is the sum of the first n odd numbers?

    The sum of the first n odd numbers (1, 3, 5, ..., 2n-1) always equals n². For example, 1+3+5+7 = 16 = 4².

    Ready to run the numbers?

    Open Arithmetic Series Sum Calculator