Sub topic 2
Even and Odd in Sums and Differences
This chapter covers how parity (whether an integer is even or odd) behaves under addition and subtraction. It assumes you already know what an integer is, can do arithmetic with negative numbers, and understand divisibility by 2. Products, powers, and consecutive integers get their own chapters.
The Working Model
An even integer is a multiple of 2, such as -4, 0, 2, or 100. An odd integer is an integer that is not a multiple of 2, such as -7, -1, 1, or 33. Zero is even, because 0 = 2 × 0. Negative integers follow the same rule: -6 is even and -5 is odd.
Adding or subtracting two integers gives a result whose parity depends only on the parity of the two inputs, not on their size or sign. This means you can predict parity without computing the actual value.
| Operation | Result |
|---|---|
| even + even | even |
| odd + odd | even |
| even + odd | odd |
| odd + even | odd |
The rule has a simple form: the result is even when the two numbers have the same parity, and odd when their parities differ.
Subtraction follows the same table. For example, 9 - 4 = 5 (odd minus even gives odd), 9 - 3 = 6 (odd minus odd gives even), and 4 - 9 = -5 (still odd). Subtracting a number gives the same parity as adding its negative, and a number and its negative always have the same parity. So a - b and a + b always have the same parity.
Why the Rules Hold
Write any even integer as 2m and any odd integer as 2n + 1, where m and n are integers.
- Even + even: 2m + 2k = 2(m + k), a multiple of 2, so even.
- Odd + odd: (2m + 1) + (2n + 1) = 2(m + n + 1), a multiple of 2, so even.
- Even + odd: 2m + (2n + 1) = 2(m + n) + 1, so odd.
The extra 1 in each odd number is what matters. Two leftover 1s combine into a 2 and vanish into the even part. One leftover 1 stays behind and makes the result odd.
You can check all four cases by running a short program. Here 0 stands for even and 1 for odd, and the printed values are the remainders after dividing by 2.
for a in (0, 1):
for b in (0, 1):
print(a, b, (a + b) % 2, (a * b) % 2)The third column is the parity of the sum. It is 1 (odd) only when exactly one of the two addends is 1. The fourth column is the parity of the product, which a later chapter covers.
Extending to Longer Sums
For a sum of many integers, only the odd terms matter. Each even term leaves the parity unchanged. Odd terms cancel in pairs.
A sum of integers is even if it contains an even number of odd terms, and odd if it contains an odd number of odd terms.
Example: is 3 + 8 + 11 + 14 + 20 even or odd? The odd terms are 3 and 11. That is two odd terms, so the sum is even. Check: 3 + 8 + 11 + 14 + 20 = 56, which is even.
Example: 5 + 7 + 9 + 12. The odd terms are 5, 7, and 9. That is three, so the sum is odd. Check: 33, which is odd.
This shortcut lets you handle a sum of 50 terms in a few seconds when you only need the parity.
Differences and Sign Do Not Matter
Subtraction can look different because it can produce negative results. But parity ignores sign. The result of 3 - 10 is -7, which is odd, exactly as the table predicts (odd minus even gives odd).
Two points about subtraction deserve attention:
- Order does not change parity. a - b and b - a are negatives of each other, so they have the same parity.
- a - b has the same parity as a + b. If you are told that a + b is odd, then a - b is also odd, even though you do not know the values.
Working Backwards: What Parity Tells You About the Inputs
Many GRE questions reverse the direction. They give the parity of a sum and ask what you can conclude about the addends.
- If x + y is odd, then exactly one of x and y is odd and the other is even. You cannot say which one.
- If x + y is even, then x and y have the same parity. Both are even or both are odd. You cannot say which.
- If x + y is even and x is even, then y must be even.
- If x + y is odd and x is odd, then y must be even.
The pattern is that once you know the parity of the sum and one addend, the other addend is fixed. With only the sum, you know the relationship but not the individual values.
A Worked Example
Problem. If a, b, and c are integers, a + b is odd, and b + c is odd, which of the following must be true?
I. a + c is even II. a + b + c is even III. a - c is odd
Solution. From a + b odd, a and b have different parity. From b + c odd, b and c have different parity. Both a and c differ from b, so a and c have the same parity. Therefore a + c is even, and statement I is true.
For statement II, split into two cases.
- Case 1: b is even. Then a and c are both odd. The sum a + b + c is odd + even + odd, which has two odd terms, so it is even.
- Case 2: b is odd. Then a and c are both even. The sum is even + odd + even, which has one odd term, so it is odd.
The two cases give different results, so statement II does not have to be true.
For statement III, a and c have the same parity, so a - c is even, not odd. Statement III is false.
Only statement I must be true.
Edge Cases
- Zero is even. Adding 0 never changes parity. If a question says "x is an integer" and you test x = 0, remember it counts as even.
- Negative integers. The rules work unchanged. For example, -3 + -5 = -8, which is even (odd plus odd).
- The integer requirement. Parity is defined only for integers. The numbers 2.5 and 1/2 are neither even nor odd. If a problem does not say the variables are integers, you cannot use these rules. Also, a sum of non-integers can be an integer: 0.5 + 0.5 = 1.
- Parity says nothing about size. Knowing that x + y is even tells you nothing about whether x > y, or whether either is positive.
Common Errors
- Assuming "odd + odd = odd." The correct result is even. A quick check is 1 + 1 = 2.
- Treating a - b as different from a + b. For parity they behave the same.
- Concluding too much from a sum. If x + y is even, you cannot conclude that x and y are both even. They may both be odd.
- Forgetting the odd-count rule for long sums. Count only the odd terms.
- Applying parity to non-integers. Check that the problem states the variables are integers.
Testing Claims With Small Values
When a statement uses "must be true," you can try small integers to look for a counterexample. One counterexample is enough to show a statement is not always true. Passing a few tests does not prove it, but it helps you decide quickly which statements are suspect.
This code checks the pattern for a claim such as "if x + y is even, then x is even," by searching for a counterexample.
cases = [(x, y) for x in range(-3, 4) for y in range(-3, 4)
if (x + y) % 2 == 0 and x % 2 != 0]
print(cases[0])The output is (-3, -3). Both numbers are odd and their sum is even, so x need not be even. This is the same search strategy a later chapter applies to many other claims.
Exercise
x, y, and z are integers. x + y is even and y + z is odd. Is x + z even, odd, or impossible to determine? Then say whether x - y + z must be even, must be odd, or could be either.
Show answer
From x + y even, x and y have the same parity. From y + z odd, y and z have different parity. So x and z have different parity, which makes x + z odd. For x - y + z, x - y is even (same parity), and adding z gives the parity of z. Since z can be either even or odd (for example x = 2, y = 2, z = 1 gives 1, odd; x = 1, y = 1, z = 2 gives 2, even), x - y + z could be either.
Exercise
The integers a, b, c, d, and e include exactly three odd numbers. Must a + b + c + d + e be even, odd, or can you not tell?
Show answer
Only the odd terms matter, and there are three of them. An odd count of odd terms gives an odd sum, so the sum must be odd.
Exercise
If n is an integer and 3n + 7 is even, is n odd or even?
Show answer
7 is odd, so 3n must be odd for the sum to be even (odd + odd = even). If 3n is odd, n must be odd. This uses a product rule previewed here and covered in the next chapter: an odd multiple of an integer is odd only when that integer is odd. So n is odd. Check with n = 1: 3 + 7 = 10, even.