Sub topic 5
Divisibility Tests Seen as Remainders
Assume you can divide integers, identify prime factors, and use congruence notation. A number N is divisible by d exactly when its remainder after division by d is zero:
N is divisible by d ⇔ N ≡ 0 (mod d)
Divisibility tests are shortcuts for finding this remainder without performing full division.
The basic tests
The tests work because place values have simple remainders. For example, 10 ≡ 1 (mod 3), so every power of 10 also has remainder 1 modulo 3. Therefore, a number and the sum of its digits have the same remainder modulo 3.
| Divisor | Test | Remainder idea |
|---|---|---|
| 2 | Last digit is 0, 2, 4, 6, or 8 | Powers of 10 after the units place are divisible by 2 |
| 3 | Digit sum is divisible by 3 | `10 ≡ 1 (mod 3)` |
| 4 | Last two digits are divisible by 4 | `100 ≡ 0 (mod 4)` |
| 5 | Last digit is 0 or 5 | `10 ≡ 0 (mod 5)` |
| 8 | Last three digits are divisible by 8 | `1000 ≡ 0 (mod 8)` |
| 9 | Digit sum is divisible by 9 | `10 ≡ 1 (mod 9)` |
| 11 | Alternating digit sum is divisible by 11 | `10 ≡ -1 (mod 11)` |
For 11, subtract digits in alternating positions. The result may be positive, negative, or zero. If it is a multiple of 11, the original number is divisible by 11.
Worked examples
Consider 7,920.
- It is divisible by 2 because its last digit is 0.
- It is divisible by 3 because
7 + 9 + 2 + 0 = 18, and 18 is divisible by 3. - It is divisible by 4 because its last two digits, 20, are divisible by 4.
- It is divisible by 5 because its last digit is 0.
- It is divisible by 8 because
920 ÷ 8 = 115. - It is divisible by 9 because its digit sum is 18.
- It is divisible by 11 because
7 - 9 + 2 - 0 = 0.
For a number such as 58,732, the digit sum is 25, so it is not divisible by 3 or 9. Its last two digits are 32, so it is divisible by 4. Its last three digits are 732, and 732 = 8 × 91 + 4, so it is not divisible by 8.
def divisibility_tests(n):
digits = [int(d) for d in str(n)]
digit_sum = sum(digits)
alternating_sum = sum(digits[::2]) - sum(digits[1::2])
return {
2: n % 2 == 0,
3: digit_sum % 3 == 0,
4: n % 4 == 0,
5: n % 5 == 0,
8: n % 8 == 0,
9: digit_sum % 9 == 0,
11: alternating_sum % 11 == 0,
}
print(divisibility_tests(7920))Why the shortcuts work
For CAT questions, first check the shortest relevant part of the number. Use the last digit for 2 or 5, the last two digits for 4, the last three for 8, and the digit sum for 3 or 9. Use the 11 test when alternating signs make the calculation small.
Exercise
Is 438,216 divisible by 3, 4, 8, 9, and 11?
Show answer
Yes for 3 because the digit sum is 24, yes for 4 because 16 is divisible by 4, yes for 8 because 216 is divisible by 8, no for 9 because 24 is not divisible by 9, and no for 11 because 4 - 3 + 8 - 2 + 1 - 6 = 2.