INTEGER DIVISIBILITY Tests
Also see the GCD/LCM Discussion File
The teacher of modern elementary school mathematics will have to quickly respond to a student's question as to whether one number the student gives you is divisible by another number. This skill is brought up every time you have to factor a set of numbers.
The following algorithms can all be explained using the arithmetic properties of the integers, mainly the decimal place value properties of our number system, The Fundamental Rule of Arithmetic (FTA: Every positive integer is the unique product of powers of a finite number of primes; uniqueness means independent of the order of the prime factors) and the properties of the divides relation. Refer to your notes on relations for proofs that these short cuts are valid.
Properties of the "Divides" relation. See Gcd/Lcm Discussion for proofs.
For any nonzero integers, a, b, c, d, or r:
i.) If a
b and a|c, then
a
(b±c).
ii.) If a
b then a
(b*c)
iii.) If a
b then a
(- b).
iv.) If d
a and d
(ac+r), then
by property iii) above, d
[(ac+r)–ac]
which says that d
r.
Note: We know that any nonzero number divides zero and that no number is divisible by zero, so it is taken for granted that all of the givens referenced below are nonzero integers. We start with the rule for the number 2.
Integer Rules
2. A number is divisible by 2 if and only if the number represented by the right‑hand digit is divisible by 2.
Examples: 12; 150; 2478; are all divisible by 2.
Explanation: 2478=2470+8 or 247*10+8. Since 2 is a factor of 10(=2*5), any
multiple of 10 is divisible by 2, i.e. 247*10 is divisible by 2 by property
ii. Also, 2
8 so 2
[(247)+8] by property i.
Hence the rule: Any number greater than ten is divisible by 2 if the
units' digit is divisible by 2.
3. A number is divisible by 3 if and only if the sum of its digits is divisible by 3.
Examples: 21 Is divisible by 3 because 3 is a factor of 21=(7*3). Also, 579 is divisible by 3 because 3 divides the sum of the digits (5+7+ 9=21) as explained below.
Explanation: 1000=999+1, 100=99+1, and 10=9+1, in fact for any power of ten,
10
=9
+1 because 9
=3*(3)
. Therefore,
for any coefficient ß, ß*10
=ß(9
+1)=ß*9
+ ß by distributivity.
We know that 3
9
because, so if 3
also divides the sum of the digits, then 3 divides the number. We apply this
to 3|579 by noting that 3
999 so 3
(5*999), 3
99 so 3
(7*99), and 3
9 , so 3 divides
579=3[(5(333)+7(33)+3(3))+(5+7+9)] by properties i. and ii. only if 3 divides
the sum of the units, that is only if 3
(5+7+9).
246=2*100+4*10+1=2*(99+1)+4*(9+1)+6=(2*99+2+4)*(9+4)+6. Since 3
99 and 3
9 then 3
(2*99+4*9) and (2+4+6)=12
are all multiples of 3, then their sum 246=(2*99+4*9)+(12) is a multiple of
3.
7641 = (7*999+7*1)+(6*99+6*1)+(4*9+4*1)+1 = (7*999+6*99+4*9)+(7+6+4+1) = 3*(7*333+6*33+4*3)+(3*6). So, 3 divides all parts of the number, therefore 3 divides the sum, 3|7641.
4. A number is divisible by 4 if and only if the number represented by the two right‑hand digits is divisible by 4.
Examples: 24; 7432; 159,52 are divisible by 4.
Explanation: 3428=3400+2A. Since 4 is a factor of 100=4*25, any multiple of 100 is divisible by 4. Hence, when determining whether a number is divisible by 4, we need only be concerned with whether the number represented by the two right‑hand digits is divisible by 4.
5. A number is divisible by 5 if and only if it ends in 5 or 0.
Examples: 75; 130; 2435; 7945; are divisible by 5.
Explanation: 2435=2430+5.
Since 5 Is a factor of 10=2*5, any multiple of 10 is divisible by 5. Hence, when determining whether a number is divisible by 5, we need only be concerned with whether the units' digit is divisible by 5.
6. A number is divisible 6 if and only if it is divisible by 2 and by 3.
6=2*3, and 2 and 3 are primes and have only 1 as a common divisor, gcd(2,3)=1
Examples: 42; 144; 2316; 17,994; are divisible by 6.
7. Double and subtract. That is, double the right-hand digit and subtract it from the number left after the unit's digit is removed. Repeat this double and subtract process until it becomes evident that 7 does or does not divide the result. This may be best seen with an example. We want to check if 7 divides 18053.
Question: Does 7 divide 18053 evenly?
Double the value of the most right hand digit that is 3 and you get 6.
Subtract 6 from the number 1805 after the unit's digit 3 is removed fm 18053. 1805-6=1799
Repeat: double 9 to get 18 and subtract 18 from 179 (1799 after the unit's digit 9 is removed) 179-18=161
Repeat: double one to get two and subtract from 16 16-2=14
We know that 7
14 so we know that
7|1805
The question is answerable at any point where is it evident that 7 does or does not divide the difference.
If we saw that 7 divides 161, then we could have stopped then and concluded that 7 does divide 18053.
94 is not divisible by 7 because 9-(2*4)=1 is not divisible by 7. However, 7 divides 6524 because 652–8=644. Continuing we see that 64-8=56 and we know that 7 divides 56. So we know that 7 divides 6524.
8. A number is divisible by 8 If and only if the number represented by the three right‑hand digits is divisible by 8.
Examples: l000, 4456 and 928 are all divisible by 8.
Explanation: 73,960=73,000+960. Since 8=
is a factor of 1000=
, any multiple of
1000 is divisible by 8. Hence, when determining whether a number is divisible
by 8, we need only be concerned with whether the number represented by the
three right‑hand digits is divisible by 8. Similarly, 2
or 16 would be determined
by the number of the four right-hand digits, but it would be smarter to use
a calculator if you had one for checking numbers of greater than three digits.
9. A number is divisible by 9 if and only if the sum of Its digits is divisible by 9.
Examples: 18,279; 4563; 19,467; are divisible by 9.
Explanation: Any power of ten when divided by 9 gives 1 as remainder. The explanation Is similar to that for the rule of divisibility for 3.
10. A number is divisible by 10 if and only If it ends in 0.
Examples: 60; 150; 2250; 94,370; are divisible by 10.
Evaluation: The student should try to explain the rule of divisibility for 10.
11. An integer is divisible by 11 if
and only if it satisfies the even minus odd test. That is, an integer
is divisible by 11 if and only if the sum of the digits in the columns that
are even powers of 10 minus the sum of the digits in the columns
that are odd powers of 10 is divisible by 11 (or vice versa, take odd-even
because if a
b then a
-b).
So 11 divides an integer if and only if 11
[(sum digits
in even columns minus sum digits in odd columns], abbreviated, 11
(sum even –
sum odd).
12. A number is divisible by 12 if and only if it is divisible by 3 and by 4.
Examples: 1788; 4044; 35,220; are divisible by 12.
Explanation: 12 = 3 x 4, and 3 and 4 are relatively prime, i.e. gcd(3,4)=1.
13. To test for divisibility
for 13, separate a number's digits into consecutive triples from right to
left, find the sum of every other triple and subtract the sum of the in-between
triples in a manner similar to the divisibility test for 11. This
gives an alternate test for 7, 11, as well as 13. I.e. (7,11,or13)
352469827 iff
(7,11,or13)
[827 - 352 + 469
]. But today it's more sensible to just get our your calculator for
integers greater than one thousand.
Composite Rule:
m
n
An integer n is divisible by an integer m if and only if n is divisible by
all of the relatively prime factors of m.
For example:
6= 2*3 and gcd(2,3)=1, so
6
m
iff
both 2
m
and 3
m.
14= 2*7 and gcd(2,7=1, so
14
m
iff
both 2
m and
7
m.
40= 5*8 and gcd(5,8)=1, so
40
m iff
both 5
m and
8
m.
Condensed Summary of the Integer Divisibility Tests (A complete write up with proofs of the following divisibility tests is given in the Integers Divisibility Tests discussion.)
a. An integer is divisible by 2, 5, or 10 if and only if its unit's digit is divisible by 2, 5, or 10, respectively.
b. An integer is divisible by 4 if and only if the number represented by the last 2 digits is divisible by 4.
c. An integer is divisible by 8 if and only if the number represented by the last 3 digits is divisible by 8.
d. An integer is divisible by 3 or by 9 if and only if the sum of its digits is divisible by 3 or 9, respectively.
e. An integer is divisible by 7 if and only it 7 divides the result after you repeatedly double and subtract the units digit. I.e. subtract double the unit's digit from the number you get after you take the units digit away. Repeat doing this until you get a number that is obviously divisible or not divisible by 7.
f. An integer
is divisible by 11 if and only if 11[(sum even)-(sum odd)]. I.e.
add every other digit then subtract the sum of digits. If 11 divides
the difference, then 11 divides the original number. It really doesn't
matter if you (sum even place value digits) subtract (sum odd place value
digits)] because d
a
d
(-a).
alt. Separate
a number's digits into consecutive triples, find the sum of every other triple
and subtract the sum of the in-between triples like for the divisibility
test for 11 gives an alternate test for 7, 11, and 13. I.e.
11
352469827 iff 11
[827 - 352
+ 469 ], but today it's a lot easier to just get our your calculator
for integers greater than one thousand.
g. m
n
An integer n is divisible by an integer m if and only if n is divisible by
all of the relatively prime factors of m.
For example, 6 divides an integer if and only if both of the relatively prime factors 2 and 3 of six divide the number.