7.2 KiB
| title | chunk | source | category | tags | date_saved | instance |
|---|---|---|---|---|---|---|
| Divisibility rule | 7/8 | https://en.wikipedia.org/wiki/Divisibility_rule | reference | science, encyclopedia | 2026-05-05T08:13:56.367542+00:00 | kb-cron |
=== Composite divisors === A number is divisible by a given divisor if it is divisible by the highest power of each of its prime factors. For example, to determine divisibility by 36, check divisibility by 4 and by 9. Note that checking 3 and 12, or 2 and 18, would not be sufficient. A table of prime factors may be useful. A composite divisor may also have a rule formed using the same procedure as for a prime divisor, given below, with the caveat that the manipulations involved may not introduce any factor which is present in the divisor. For instance, one cannot make a rule for 14 that involves multiplying the equation by 7. This is not an issue for prime divisors because they have no smaller factors. To test the divisibility of a number by a power of 2 or a power of 5 (2n or 5n, in which n is a positive integer), one only need to look at the last n digits of that number. To test divisibility by any number expressed as the product of prime factors
p
1
n
p
2
m
p
3
q
{\displaystyle p_{1}^{n}p_{2}^{m}p_{3}^{q}}
, we can separately test for divisibility by each prime to its appropriate power. For example, testing divisibility by 24 (24 = 8 × 3 = 23 × 3) is equivalent to testing divisibility by 8 (23) and 3 simultaneously, thus we need only show divisibility by 8 and by 3 to prove divisibility by 24.
=== Prime divisors === The goal is to find an inverse to 10 modulo the prime under consideration (does not work for 2 or 5) and use that as a multiplier to make the divisibility of the original number by that prime depend on the divisibility of the new (usually smaller) number by the same prime. Using 31 as an example, since 10 × (−3) = −30 = 1 mod 31, we get the rule for using y − 3x in the table below. Likewise, since 10 × (28) = 280 = 1 mod 31 also, we obtain a complementary rule y + 28x of the same kind - our choice of addition or subtraction being dictated by arithmetic convenience of the smaller value. In fact, this rule for prime divisors besides 2 and 5 is really a rule for divisibility by any integer relatively prime to 10. This is why the last divisibility condition for any number relatively prime to 10 has the same kind of form (add or subtract some multiple of the last digit from the rest of the number).
== Generalized divisibility rule ==
=== Divisors Ending in 1, 3, 7, or 9 in base 10 === To test for divisibility by D, where D ends in 1, 3, 7, or 9, the following method can be used. Find any multiple of D ending in 9. (If D ends respectively in 1, 3, 7, or 9, then multiply by 9, 3, 7, or 1.) Then add 1 and divide by 10, denoting the result as m. Then a number N = 10t + q is divisible by D if and only if mq + t is divisible by D. If the number is too large, you can also break it down into several strings with e digits each, satisfying either 10e = 1 or 10e = −1 (mod D). The sum (or alternating sum) of the numbers have the same divisibility as the original one. For example, to determine whether 913 = 10 × 91 + 3 is divisible by 11, find that m = (11 × 9 + 1) ÷ 10 = 10. Then mq + t = 10 × 3 + 91 = 121; this is divisible by 11 (with quotient 11), so 913 is also divisible by 11. As another example, to determine whether 689 = 10 × 68 + 9 is divisible by 53, find that m = (53 × 3 + 1) ÷ 10 = 16. Then mq + t = 16 × 9 + 68 = 212, which is divisible by 53 (with quotient 4); so 689 is also divisible by 53. Alternatively, any number Q = 10c + d is divisible by n = 10a + b, such that gcd(n, 2, 5) = 1, if c + D(n)d = An for some integer A, where
D
(
n
)
≡
{
9
a
+
1
if
n
=
10
a
+
1
,
3
a
+
1
if
n
=
10
a
+
3
,
7
a
+
5
if
n
=
10
a
+
7
,
a
+
1
if
n
=
10
a
+
9.
{\displaystyle D(n)\equiv {\begin{cases}9a+1&{\text{if }}n=10a+1,\\3a+1&{\text{if }}n=10a+3,\\7a+5&{\text{if }}n=10a+7,\\a+1&{\text{if }}n=10a+9.\end{cases}}}
The first few terms of the sequence, generated by D(n), are 1, 1, 5, 1, 10, 4, 12, 2, ... (sequence A333448 in the OEIS). The piece wise form of D(n) and the sequence generated by it were first published by Bulgarian mathematician Ivan Stoykov in March 2020.
=== Divisors that are powers of a factor of the base === For D in base b, where there exists some
n
∈
N
{\displaystyle n\in \mathbb {N} }
, and
d
|
b
{\displaystyle d|b}
such that
D
=
(
b
d
)
n
{\displaystyle D=\left({\frac {b}{d}}\right)^{n}}
, the following is a test to check if some number u is divisible by D. Take u' equal to u truncated to the lowest n digits in base b. The divisibility of u by D is the same as the divisibility of u' by D. Multiply u' by
d
n
{\displaystyle d^{n}}
, if the number of trailing zeros in the product is greater than or equal to n, then u is divisible by D. Truncating u is not strictly necessary but is generally faster.
== Proofs ==