Divisor Tests
- 2: the last digit is 0, 2, 4, 6, 8 or X.
- 3: the last digit is 0, 3, 6 or 9.
- 4: the last digit is 0, 4 or 8.
- 6: the last digit is 0 or 6.
Regular Tests
- 8:
- The second-last digit is even, the last digit is 0 or 8.
- The second-last digit is odd, the last digit is 4.
- 14: the last two digits are 00, 14, 28, 40, 54, 68, 80, 94 or X8.
- 28:
- The third-last digit is even, the last two digits are 00, 28, 54, 80 or X8.
- The third-last digit is odd, the last two digits are 14, 40, 68 or 94.
If you think testing for 54 is worth the effort, the following three-digit numbers are to be memorised: 000, 054, 0X8, 140, 194, 228, 280, 314, 368, 400, 454, 4X8, 540, 594, 628, 680, 714, 768, 800, 854, 8X8, 940, 994, X28, X80, E14, E68. This also enables you to test for X8, using the same principle as for 28: check whether the fourth-last digit is even or odd, and the last three digits for being a multiple of X8 (000, 0X8, 194, 280 and so on) or a multiple of 54 that does not divide by X8 (054, 140, 228, 314 and so on).
Beyond the seventh binary power, X8, there is no usable regular test available.
- 9:
- The second-last digit is 3n, the last digit is 0 or 9.
- The second-last digit is 3n−1, the last digit is 3.
- The second-last digit is 3n+1, the last digit is 6.
The SPD Test for 5
SPD stands for 'Split, Promote, Discard', referring to the operations involved. But first, in order for SPD to work, you must memorise all the two-digit multiples of 5:
00 05 0X 13 18 21 26 2E 34 39 42 47
50 55 5X 63 68 71 76 7E 84 89 92 97
X0 X5 XX E3 E8
The SPD test works as follows:
- Split the tested number into two groups, one containing the last two digits and the other containing all the rest.
- Promote the number in the second group (the last two digits) to a multiple of 5, using addition or subtraction.
- Do the same operation you performed for the previous step, on the first group (ie if you added 2 to promote the second group, add 2 to the first group).
- Discard the second group.
- Repeat from the first step until the number cannot be shortened further. If this number is a multiple of 5, then so is the tested number.
Examples:
- 1E53 → 1E|53 → 1E|55 → 21|55 → 21. As 21 is a multiple of 5, 1E53 is divisible by 5.
- 402854 → 4028|54 → 4028|55 → 4029|55 → 4029 → 40|29 → 40|2E → 42|2E → 42. The number is divisible by 5.
- 9887 → 98|87 → 98|84 → 95|84 → 95. 95 is not a multiple of 5, therefore 9887 is not divisible by 5.
- 38843 → 388|43 → 387|42 → 387 → 3|87 → 0|84 or 5|89. Both pairs of numbers are divisible by 5, therefore 38843 passes the test.
- 23XX93854 → 23XX938|54 → 23XX939|54 → 23XX939 → 23XX9|39 → 23XX9 → 23X|X9 → 23E|XX → 23E → 2|3E → 0|39 → 0. The number is divisible by 5.
Neighbour Tests
- E: sum all the digits of the tested number. If the sum is a multiple of E, then the number divides by E. The test can be repeated if the sum is too long to recognise as a multiple of E or not.
- 11: sum the digits of the tested number in odd places, then sum the digits in even places. If the difference of the two sums is a multiple of 11, then the number divides by 11.
Testing for 7 and Other Primes
There is no easy divisibility test for 7 or primes higher than 11. A variety of universal tests can be employed, such as trying to express the tested number as the sum or difference of two known multiples, or simply doing long division.
For 7, if the number is long, one can shorten it down to three digits by using repeated subtraction of the last three digits from all the rest:
- 1X294 → 1X|294 → 294−1X = 276
To test the number 276, the following methods are found:
- Trim-right test (1): split the last digit from the rest, multiply it by 3 and add it to the rest. Repeat until you get a number you know to be a multiple of 7. 276 → 27|6 → 27+16 = 41, which is the square of 7.
- Trim-right test (2): split the last digit from the rest, multiply it by 4 and subtract it from the rest. Repeat as necessary. 276 → 27|6 → 27−20 = 7.
- Placeholder test: express the number as a sum or difference of two numbers, one of which you know to be a multiple of 7. If the second of that pair is a multiple of 7 also, then the tested number divides by 7. 276 = 240 + 36; as 240 and 36 are both multiples of 7, and should be recognised as such if one remembers the basic dozenal multiplication table, 276 passes the divisibility test.
Other primes have different multipliers for the trim-right test. Whereas those for 7 have been given here as 3 and −4, those for 15 are X and −7, those for 17 are 8 and −E, and those for 1E are 2 and −19.
Compound Tests
These are simply a matter of combining tests as needed. For example, as X equals 2·5, a number divisible by X is one whose final digit is 0, 2, 4, 6, 8 or X and passes the SPD test.