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 Even and Odd Numbers in a Range — Moosa Academy

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  +1 is added.

Theorem The two rules

Count of evens  = \dfrac{\text{last even} - \text{first even}}{2} + 1 , and count of odds  = \dfrac{\text{last odd} - \text{first odd}}{2} + 1 .

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  4, 6, 8, 10, 12 . Subtracting gives  12 - 4 = 8 , but that is the total distance, not the number of jumps.

Each jump covers  2 , so there are  8 \div 2 = 4 jumps. Adding  1 for the starting number gives  5 — 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  13 and  67 ?

"Between" excludes  13 and  67 themselves
First even inside the range:  14
Last even inside the range:  66
Apply the rule:  \dfrac{66 - 14}{2} + 1
Simplify:  \dfrac{52}{2} + 1 = 26 + 1
 27 even numbers

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

Example Odds between 13 and 67

How many odd numbers lie between  13 and  67 ?

 13 and  67 are both odd, and "between" excludes them
First odd inside the range:  15
Last odd inside the range:  65
Apply the rule:  \dfrac{65 - 15}{2} + 1
Simplify:  \dfrac{50}{2} + 1 = 25 + 1
 26 odd numbers

A useful cross-check: all the numbers between  13 and  67 total  67 - 13 - 1 = 53 , and  27 + 26 = 53 . 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  \dfrac{17}{5} to  \dfrac{87}{6} ?

Convert to decimals:  \dfrac{17}{5} = 3.4 and  \dfrac{87}{6} = 14.5
The question becomes: how many evens from  3.4 to  14.5 ?
First even at or above  3.4 :  4
Last even at or below  14.5 :  14
Apply the rule:  \dfrac{14 - 4}{2} + 1 = 5 + 1
 6 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  \dfrac{\text{last} - \text{first}}{2} + 1 .
  2. Divide by  2 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.