Opening the reading…
Opening the reading…
DSA FUNDAMENTALS › MATH BASICS
A divisibility rule is a shortcut for one exact question: does 27720 % d equal 0? If the remainder is 0, the divisor d divides 27720. If the remainder is not 0, it does not. The shortcut may inspect the ending digits, combine digits, or repeatedly transform the number, but it must always give the same yes or no result as the remainder test.
The divisor 1 always gives yes, because every integer has remainder 0 when divided by 1. For the other divisors from 1 to 20, you can use a shorter rule first and then verify the finished classification with 27720 % d. The point of grouping the checks is not to replace correctness, but to reach the same remainder conclusion with less repeated work.
A decimal number can be split into a prefix and a suffix. For divisors that divide a power of 10, the prefix contributes no remainder to the relevant test, so the ending digits decide the result. For 27720, the last digit is 0, the last two digits are 20, the last three digits are 720, and the last four digits are 7720.
| DIVISOR | DIGITS USED | RESULT | REASON |
|---|---|---|---|
| 2 | 0 | yes | The last digit is even. |
| 4 | 20 | yes | 20 is divisible by 4. |
| 5 | 0 | yes | The last digit is 0 or 5. |
| 8 | 720 | yes | 720 is divisible by 8. |
| 10 | 0 | yes | The last digit is 0. |
| 16 | 7720 | no | 7720 % 16 is 8. |
| 20 | 20 | yes | The last two digits are 20. |
The four-digit suffix is enough for 16 because 10000 is divisible by 16. The last four digits of 27720 are 7720, and 7720 is 8 greater than a multiple of 16, so the answer is no. The same ending idea gives yes for 2, 4, 5, 8, 10, and 20.
Which suffix should you test for divisibility by 16, and what result does it give for 27720?
Checkpoints are not graded. They are here so you catch yourself before the quiz does — stuck, ask the tutor on the right.
The digits of 27720 are 2, 7, 7, 2, and 0. Their ordinary sum is 2 + 7 + 7 + 2 + 0 = 18. Since 18 is divisible by both 3 and 9, the number 27720 is divisible by both 3 and 9. The same digit sum answers two checks because 9 is a stronger factor requirement than 3.
Divisibility by 11 uses a different combination of the same digits. Subtract alternating positions instead of adding every digit: 2 - 7 + 7 - 2 + 0 = 0. The alternating sum is 0, so 27720 is divisible by 11. Keep these results separate: the ordinary digit sum is 18, while the alternating sum is 0.
| CHECK | CALCULATION | RESULT |
|---|---|---|
| 3 | 2 + 7 + 7 + 2 + 0 = 18 | yes |
| 9 | 2 + 7 + 7 + 2 + 0 = 18 | yes |
| 11 | 2 - 7 + 7 - 2 + 0 = 0 | yes |
For these prime divisors, the last digit can be removed after a small adjustment. For 7, subtract twice the last digit from the remaining prefix. For 13, add four times the last digit. For 17, subtract five times the last digit. For 19, add twice the last digit. Each transformation preserves the question of divisibility, so the original number is divisible exactly when the smaller result is.
| DIVISOR | TRANSFORMATION TRACE | RESULT |
|---|---|---|
| 7 | 27720 -> 2772 -> 277 -> 273 -> 27 -> 21 -> 0 | yes |
| 13 | 27720 -> 2772 -> 285 -> 48 -> 36 -> 27 -> 30 -> 3 | no |
| 17 | 27720 -> 2772 -> 267 -> -9 | no |
| 19 | 27720 -> 2772 -> 281 -> 30 -> 3 | no |
For 7, the last digit of 27720 is 0, so the first result is 2772. The last digit of 2772 is 2, giving 277 - 4 = 273. Continuing gives 27, then 21, then 0. Because 0 is divisible by 7, every value in that trace has the same yes outcome as 27720.
Complete the repeated subtract-twice-the-last-digit trace for divisibility by 7: 27720 -> 2772 -> 277 -> 273 -> 27 -> 21 -> ?
27720 -> 2772 -> 277 -> 273 -> 27 -> 21 -> ?Checkpoints are not graded. They are here so you catch yourself before the quiz does — stuck, ask the tutor on the right.
A composite divisor can often be checked by testing factors that are co-prime and whose product is the target. Since 27720 passes the needed smaller checks, it also passes the checks for 6, 12, 14, 15, and 18.
| DIVISOR | FACTOR CHECKS | RESULT FOR 27720 |
|---|---|---|
| 6 | 2 and 3 | yes |
| 12 | 3 and 4 | yes |
| 14 | 2 and 7 | yes |
| 15 | 3 and 5 | yes |
| 18 | 2 and 9 | yes |
The factor choices must contain every required prime power. For 12, checking only 2 and 6 is not enough in general, because those checks together require only the factors in 6, not the full factorization 12 = 2 * 2 * 3. Checking 3 and 4 does establish 12 because 3 and 4 are co-prime and their product is 12. Likewise, 2 and 9 establish 18 because their product is 18.
| DIVISOR | 27720 % DIVISOR | DIVISIBLE |
|---|---|---|
| 1 | 0 | yes |
| 2 | 0 | yes |
| 3 | 0 | yes |
| 4 | 0 | yes |
| 5 | 0 | yes |
| 6 | 0 | yes |
| 7 | 0 | yes |
| 8 | 0 | yes |
| 9 | 0 | yes |
| 10 | 0 | yes |
| 11 | 0 | yes |
| 12 | 0 | yes |
| 13 | 4 | no |
| 14 | 0 | yes |
| 15 | 0 | yes |
| 16 | 8 | no |
| 17 | 10 | no |
| 18 | 0 | yes |
| 19 | 18 | no |
| 20 | 0 | yes |