Sum of Even Numbers Calculator

Total the evens up to n in one step.

How it is calculated

The tool adds the even numbers 2 + 4 + 6 + … up to and including n (if n is itself even). It first counts them: k = ⌊n / 2⌋, rounding down. Then the sum is S = k × (k + 1), because 2 + 4 + … + 2k = 2 × (1 + 2 + … + k). So an odd limit such as 51 gives the same result as 50, since 51 is not itself even. n must be a whole number of at least 2; 0, 1, negatives and decimals give no result. Both the sum and the count are shown as integers with thousands separators. This is the sum of even numbers only, not of all numbers up to n.

Worked example

Add the even numbers up to 50. Count them: ⌊50 / 2⌋ = 25, so k = 25. The sum is k × (k + 1) = 25 × 26 = 650. The calculator shows a sum of 650 and a count of 25. As a check, 2 + 4 + … + 50 is an arithmetic series with 25 terms and average (2 + 50) / 2 = 26, and 25 × 26 = 650.

Try this example →

Common mistakes

  • Entering the number of even terms as n. The tool expects the upper limit: for the first 25 even numbers enter 50, not 25.
  • Expecting n = 51 to include 51. Only even numbers are added, so the last term is 50.
  • Using n × (n + 1) / 2, which is the sum of all numbers rather than the even ones.
  • Entering 1. The smallest even number is 2, so n = 1 gives no result.
  • Using this for odd numbers. The sum of the first k odd numbers is k², a different formula.

About this calculator

The sum of every even number from 2 up to n follows a closed-form formula: if m is the count of even numbers up to n (m = n / 2, rounded down), the sum equals m × (m + 1), a direct consequence of the classic arithmetic-series result Gauss is famously said to have discovered as a schoolboy for summing consecutive integers.

This calculator is used in math education to demonstrate how a closed-form formula replaces manual addition or a loop-based sum, and it is a common early exercise in programming courses that teaches students to derive an O(1) formula instead of writing an O(n) loop to add up numbers one at a time.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators