Counting Even and Odd Numbers in a Range

Counting only the evens in a range needs one extra step: evens advance two at a time, so the distance between the ends must be halved before the usual plus one is added.

--

Counting only the even numbers in a range needs one extra step beyond the ordinary count. Evens advance two at a time, so the distance between the ends has to be halved before the usual is added.

Theorem The two rules

Count of evens , and count of odds .

The two formulas are identical in shape. All that changes is which endpoints you pick — the first and last even number inside the range, or the first and last odd one.

Concept Why divide by two
Take the evens . Subtracting gives , but that is the total distance, not the number of jumps.

Each jump covers , so there are jumps. Adding for the starting number gives — exactly the count.

It is the same fence-post idea as before, with one difference: the posts now stand two units apart, so the distance must be divided by the step before counting.

Example Evens between 13 and 67

How many even numbers lie between and ?

"Between" excludes and themselves
First even inside the range:
Last even inside the range:
Apply the rule:
Simplify:
even numbers

Both endpoints happen to be odd here, so excluding them changes nothing for the evens. Had the range been to "between", the first even would have been .

Example Odds between 13 and 67

How many odd numbers lie between and ?

and are both odd, and "between" excludes them
First odd inside the range:
Last odd inside the range:
Apply the rule:
Simplify:
odd numbers

A useful cross-check: all the numbers between and total , and . Every number is either even or odd, so the two counts must add to the whole.

Example When the ends are fractions

How many even numbers are there from to ?

Convert to decimals: and
The question becomes: how many evens from to ?
First even at or above :
Last even at or below :
Apply the rule:
even numbers

Fractional endpoints are not a special case. Turn them into decimals, step inward to the nearest even number at each end, then use the same formula.

Summary
  1. Both counts use .
  2. Divide by because evens and odds advance in steps of two.
  3. Always identify the first and last qualifying number inside the range before substituting.
  4. "Between" excludes the given endpoints; "from … to" includes them.
  5. Check your work: evens plus odds must equal the total count of numbers in the range.
  6. For fractional endpoints, convert to decimals and step inward to the nearest qualifying number.