Sub topic 12
Consecutive Integers and Guaranteed Divisibility
This chapter assumes you know the division algorithm (n = dq + r with 0 ≤ r < d), what it means for one integer to divide another, and how to factor small integers into primes. It builds on the earlier chapters on factors and multiples and on division with remainder.
Consecutive integers are integers that differ by 1, such as 14, 15, 16. A GRE question may give you consecutive integers without naming any of them. You can still be certain some of them are divisible by certain numbers. This chapter explains why that certainty exists and how to use it.
The core fact: one multiple of k in every run of k
Take any k consecutive integers. Their remainders when divided by k are k different values, and they cycle through 0, 1, ..., k − 1 in order. Exactly one integer in the run has remainder 0, so exactly one is a multiple of k.
The same idea in terms of n = kq + r: as you move from n to n + 1, the remainder r goes up by 1, or wraps from k − 1 back to 0. In k steps it must pass through 0.
The diagram shows this for k = 3, the run n, n + 1, n + 2.
This works for negative integers and for 0, because 0 is a multiple of every integer. In the run −1, 0, 1, the multiple of 3 is 0.
Products of consecutive integers
Divisibility facts combine. A product is divisible by every number that divides any one of its factors, and also by products of divisors that come from different factors.
- Two consecutive integers: one is even, so n(n + 1) is divisible by 2.
- Three consecutive integers: one is a multiple of 3, and at least one is even, so n(n + 1)(n + 2) is divisible by 2 × 3 = 6.
- Four consecutive integers: two are even, and one of those is a multiple of 4. The even pair supplies at least 2 × 4 = 8. One of the four is a multiple of 3. So the product is divisible by 8 × 3 = 24.
- Five consecutive integers: the product of four is divisible by 24, and one of the five is a multiple of 5, so the product is divisible by 120.
The pattern is that the product of k consecutive integers is divisible by k!. This table lists the guarantees.
| Run length k | Guaranteed divisor | Equals |
|---|---|---|
| 2 | 2! | 2 |
| 3 | 3! | 6 |
| 4 | 4! | 24 |
| 5 | 5! | 120 |
A guarantee is the largest divisor that holds for every run, not for the one you happen to see. The run 3, 4, 5 has product 60, which is divisible by 12. But the run 1, 2, 3 has product 6, so 12 is not guaranteed. To show that a bigger divisor is not guaranteed, find one run that fails.
You can check the pattern by brute force, including negative starting values and zero.
from math import factorial, prod
for k in range(2, 7):
ok = all(
prod(n + i for i in range(k)) % factorial(k) == 0
for n in range(-50, 51)
)
print(k, factorial(k), ok)
# 2 2 True
# 3 6 True
# 4 24 True
# 5 120 True
# 6 720 TrueA passing test over a range is not a proof, but it is a good way to catch a claim you misremembered.
Worked example: n³ − n
Is n³ − n always divisible by 6 for any integer n?
Factor it: n³ − n = n(n² − 1) = (n − 1)n(n + 1). These are three consecutive integers, so the product is divisible by 6.
Check with n = 4: 3 × 4 × 5 = 60 = 6 × 10. Check with n = 0: (−1)(0)(1) = 0, which is divisible by 6.
Factoring an expression into consecutive terms is the most common way this idea appears in algebraic form. Look for products like n(n + 1), (n − 1)n(n + 1), or n(n + 2) when n is even.
Consecutive even or odd integers
"Consecutive even integers" are 2m, 2m + 2, 2m + 4, and so on. They differ by 2, so they behave like consecutive integers multiplied by 2.
- Two consecutive even integers: 2m × (2m + 2) = 4m(m + 1). Since m(m + 1) is even, the product is divisible by 8.
- Three consecutive even integers: 2m × (2m + 2) × (2m + 4) = 8 × m(m + 1)(m + 2). The part m(m + 1)(m + 2) is divisible by 6, so the product is divisible by 48.
Check: 2 × 4 × 6 = 48, and 4 × 6 × 8 = 192 = 48 × 4.
Consecutive odd integers are different. They are never divisible by 2, so you cannot get a factor of 2 from them. Among three consecutive odd integers, one is still a multiple of 3, because they have the form n, n + 2, n + 4 and these three have different remainders mod 3. The product 1 × 3 × 5 = 15 shows that 3 is the only guarantee here beyond the factor 5 from that example, which does not hold in general (3 × 5 × 7 = 105 works, but 5 × 7 × 9 = 315 also includes a multiple of 5, while 7 × 9 × 11 = 693 does not).
from math import prod
evens2 = [prod((2 * m, 2 * m + 2)) for m in range(-10, 11)]
evens3 = [prod((2 * m, 2 * m + 2, 2 * m + 4)) for m in range(-10, 11)]
print(all(x % 8 == 0 for x in evens2)) # True
print(all(x % 48 == 0 for x in evens3)) # TrueSums of consecutive integers
Sums have their own guarantees.
- The sum of k consecutive integers, when k is odd, equals k times the middle integer. So it is divisible by k. For example, 7 + 8 + 9 + 10 + 11 = 45 = 5 × 9.
- When k is even, the sum is not guaranteed to be divisible by k. For example, 1 + 2 + 3 + 4 = 10, which is not divisible by 4. It is, however, k/2 times an odd number. Here 10 = 2 × 5.
for start in (1, 7, -3):
run = range(start, start + 5)
print(sum(run), sum(run) % 5) # remainder is 0 each timeUsing this on GRE questions
Questions usually say "n is an integer" and ask whether something is divisible by a number, or compare a remainder. A reliable approach has three steps.
- Rewrite the expression as a product of consecutive integers if you can.
- Count how many factors of each prime the run guarantees.
- Test the claim with the smallest runs that could fail, and include one run starting at an odd number and one at an even number.
Quantitative comparison questions need extra care. If Column A is "the remainder when n(n + 1)(n + 2) is divided by 6" and Column B is 0, the answer is that the columns are equal, because the product is always a multiple of 6. This is a case where the relationship can be proved for all integers, so the answer is not "cannot be determined".
Common errors
- Assuming a guarantee larger than k!. The product of three consecutive integers is divisible by 6, not by 12 or 24.
- Treating "consecutive even integers" as if they were consecutive integers. They differ by 2, so the guarantees change (two of them give 8, not 2).
- Forgetting that the guarantee depends on the count of terms. A run of three has a multiple of 3. A run of two may not.
- Concluding that a sum of an even number of consecutive integers is divisible by that number. It generally is not.
- Skipping 0 and negatives when testing. They are valid values unless the problem restricts them.
Exercise
If n is an even integer, show that n(n + 1)(n + 2) is divisible by 24.
Show answer
Since n is even, n and n + 2 are consecutive even integers, so their product is divisible by 8. Among the three consecutive integers n, n + 1, n + 2, exactly one is a multiple of 3. The factors 8 and 3 share no prime, so the product is divisible by 8 × 3 = 24. Check with n = 4: 4 × 5 × 6 = 120 = 24 × 5.
Exercise
The sum of five consecutive integers is 85. What is the product of the smallest and largest of the five, and is the sum of any four consecutive integers always divisible by 4?
Show answer
The sum of five consecutive integers is 5 times the middle integer, so the middle integer is 85 ÷ 5 = 17. The integers are 15, 16, 17, 18, 19, so the product of smallest and largest is 15 × 19 = 285. The sum of four consecutive integers is not always divisible by 4: 1 + 2 + 3 + 4 = 10, which leaves remainder 2.