Divisibility Solutions PDF
Divisibility Solutions PDF
Divisibility Solutions PDF
Preliminaries
Base 10 Arithmetic
Problems
What is 7777 + 1 in base 8?
Solution: In base 10, 7 + 1 = 8, but in base 7, 7 + 1 = 10. So
7777 + 1 = 7770 + 10 = 7700 + 100 = 7000 + 1000 = 10000.
In what base is 212 equal to 22510 ?
Solution: call the base b. Then in base 10, (2 b + 1)2 = 225. So
2b + 1 = 15. Thus b = 7.
You ask your cyborg friend what it would like to eat. It replies 48,879.
Knowing that your cyborg friend thinks in hexidecimal but speaks in
decimal, what should you feed it?
Solution: Its first useful to compute some powers of 16; 162 = 256,
163 = 4096, and 164 = 69632. Notice that this last power of 16 is
larger than the given number, so well only need 4 hexidecimal digits.
The largest multiple of 4096 that can be subtracted from 48869 is 11,
which in hexidecimal is B. This leaves 3823. The largest multiple of
256 which can be subtracted from this is 14, or E, which leaves 239.
Continuing this, we find that out cyborg friend asked for BEEF.
Divisibility Tests
Divisibility by Powers of 2
Problems
Is 1, 234, 567, 890 divisible by 2?
Solution: The last digit is 0, which is divisible by 2. So 1, 234, 567, 890
is divisible by 2.
Is 12113 1014 divisible by 2?
Solution: Any number ending in 1, when raised to any power, still ends
in 1. Can you see why? So both 12113 and 1014 end in 1. This means
that their difference ends in 0, which is divisible by 2. So 12113 1014
is divisible by 2.
Prove that 178212 + 184112 6= 192212 . Do you know why your calculator
is wrong?
Solution: 17822 and 19222 are each divisible by 2, while 18412 is not.
Can you see why? So the equation cant be true. Your calculator is
wrong because these numbers have over 40 digits and your calculator
cant accurately keep track of them all when computing the additions,
subtractions, and roots.
How do you prove the 2n case?
Solution: Notice that 100 is divisible by 4, that 1000 is divisible by 8
and that in general 10n is divisible by 2n . So, we can write any k digit
number as m = dk dk1 . . . d2 d1 = 10n (dk . . . dn+1 ) + dn dn1 . . . d2 d1 . So
m is divisible by 2n if and only if dn . . . d1 is.
Divisibility by 3 and 9
Problems
Does the above proof also work for the case of divisibility by 9?
Solution: Yes. As you can see, all of the terms that were described as
being divisible by 3 are actually divisible by 9 as well.
Divisibility by Powers of 5
Problems
Is 1, 234, 567, 890 divisible by 5?
Solution: The last digit is 0 which is divisible by 5, so the number is
divisible by 5.
How many 3 digit numbers are divisible by 5?
Solution: The only numbers divisible by 5 are numbers which end in
5 or 0. So we want to know how many numbers between 99 and 1000
end in a 5 or a 0. The first one is 100 and the last is 995, so there are
1 + (995 100)/5 = 180 such numbers.
Find a divisibility test for 125. Use your test to decide if 1, 234, 567, 890, 000
is visible by 750.
Solution: Notice that 100 is divisible by 25, that 1000 is divisible by
125 and that in general 10n is divisible by 5n . We write any k digit
number as m = dk . . . d1 = 10n (dk . . . dn+1 ) + dn . . . d1 . So a number
is divisible by 5n if and only if its last n digits form a number which
4
Divisibility by 7
Problems
Is 623 divisible by 7?
Solution: 62 2 3 = 56, and 56 is divisible by 7. So 623 is divisible
by 7.
Is 1, 234, 567, 890 divisible by 7?
Solution: At each step we remove the last digit, double it, and subtract
it from what remains.
1234567890
123456789
12345660
1234566
123444
12336
1221
120
12
So the number is not divisible by 7.
Find a divisibility test for your favorite prime number.
Solution: See the website for a document about this.
Divisibility by Powers of 10
Problems
Is 100110017 98125218092 divisible by 10?
Solution: Any number ending in 1, when raised to any power, still ends
in a 1. Can you see why? Any number ending in 9, when squared, also
ends in 1. So the difference of the two numbers above ends in 0. So it
is divisible by 10.
How many zeros are there at the end of the decimal representation of
25! ? If this number is written in binary (base 2), how many zeros are
at the end of it? Can you think of a base in which this number has
only 1 zero at the end of it?
Solution Part 1: To know how many zeros 25! has, we need to know
how many powers of 10 it is divisible by. To figure this out, lets make
a list of all the integers 25 which are divisible by either 2 or 5,
{2, 4, 5, 6, 8, 10, 12, 14, 15, 16, 18, 20, 22, 24, 25}. Now, lets take this list
and look at only the powers of 2 or 5 that it contains. The powers of
two that each contains are {1, 2, 0, 1, 3, 1, 2, 1, 0, 4, 1, 2, 1, 3, 0}. So there
are a total of 22 powers of 2. The powers of 5 that each of these number
contain are {0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 2}. So the total number of
powers of 5 is 6. The number 222 56 ends in 6 zeros. Can you see
why? So 25! ends in 6 zeros.
Solution Part 2: If a number is divisible by 2 but not 4, then in binary,
it ends in a zero. If a number is divisible by 4 but not 8, then in binary
it ends in 00. In general, if a number is divisible by 2n but not 2n+1 ,
then in binary it end in a series of n zeros. Can you see why? Because
we have shown that 25! is divisible by 222 but ot 223 , then in binary it
ends in a series of 22 zeros. If we use the base 25!, then (25!)25! = 10,
which ends in one zero.
If n is an integer, do n5 and n always have the same last digit?
Solution: They both have the same last digit if and only if n5 n ends
in 0, or in other words, n5 n is divisible by 10. Lets check to see if
this is true. If n is odd, then so is n5 . If n is even, then so is n5 . This
shows that n5 n is always even. Can you see why? So we only need
t show that n5 n is divisible by 5. By another problem below, np n
6
Divisibility by 11
Problems
Is 1001 divisible by 11?
Solution: 1 0 + 0 1 = 0 which is divisible by 11, so 1001 is.
Is 1, 234, 567, 890 divisible by 11?
Solution 1 2 + 3 4 + 5 6 + 7 8 + 9 = 5 which is not divisible by
11, so the number isnt either.
Can the numbers {1, 2, 3, 4} be arranged into a four digit number that
is divisible by 11? What about the numbers {1, . . . , 8}?
Solution: Yes. 1 2 + 4 3 = 0 which is divisible by 11, so 1243 is.
The key to this was creating a sequence of +1 and 1 that canceled,
12+43 = 1+1 = 0. Notice also that 12+43+56+87 =
1+11+1 = 0. So 12435687 is divisible by 11. Can you find others?
Its easy to see that 1133 is divisible by 11. Using this, show very
quickly that 3113 and 1, 001, 003, 003, 000 are also divisible by 11.
Solution: Because 1 1 + 3 3 is divisible by 11, this divisibility isnt
effected if we just change the order of the two additions 3 1 + 1 3.
Also, notice that the paris of zeros in 1001003003000 dont effect the
alternating sum of digits. So this number is divisible if 11330 is. But
we know this is divisible by 11 because 1133 is.
If a number has every one of its digits equal, under what conditions is
that number divisible by 11?
Solution: Suppose the number has n digits, all ks. If n is even, then
k k + k k + . . . + k k = 0 is divisible by 11, so the number is. If
n is odd, then k k + k k + . . . k + k = k which is not divisible by
11. So a number whose digits are all the same is divisible by 11 if and
only if it has an even number of digits.
(p + 1) 1 =
p
X
k=0
p
X
k=1
p
= p
p!
pk 1
k!(p k)!
p!
pk
k!(p k)!
X
k=1
p1
= p
X
k=0
p!
pk1
k!(p k)!
p!
pk
(k + 1)!(p k 1)!
n!
q!(nq)!
As proved below,
is always an integer for 0 q n. So each
term in the series is an integer. But we can do better than this. By
p!
an
a problem above, p! is divisible by p. So not only is (k+1)!(pk1)!
integer, but it is an integer divisible by p. Can you see why? So each
term in the series is divisible by p. So (p + 1)p 1 is divisible by p2 .
4. Prove that np n is divisible by p if p is a prime number. This is known
as Fermats Little Theorem.
Solution: Notice that 1p 1 = 0 is divisible by p. We now use induction.
Suppose that np n is divisible by p for all 1 n N . Then
p
X
p!
p
(N + 1) (N + 1) =
N k (N + 1)
k!(p
k)!
k=0
p
X
k=1
p1
k=1
p!
Nk N
k!(p k)!
p!
N k + (N p N )
k!(p k)!
As we have shown in other problems, the terms in the series are all
integers divisible by p. Therefor the entire series is divisible by p. Also,
we know that N p N is divisibly by p. This shows that (N +1)p (N +1)
is divisible by p. So by induction np n is divisible by p for all 1 n.
The Binomial Theorem
Problems
Check that
n!
k!(nk)!
(n1)!
(k1)!(nk)!
(n1)!
.
k!(nk1)!
Solution:
(n 1)!
(n 1)!
(n 1)!
1
1
+
=
+
(k 1)!(n k)! k!(n k 1)!
(k 1)!(n k 1)! n k k
n
(n 1)!
=
(k 1)!(n k 1)! k(n k)
n!
=
k!(n k)!
Use the previous problem (and
to show that the coefficients
induction)
n!
in the binomial expansion k!(nk)! are always integers.
n!
Solution: Define C(n, k) = k!(nk)!
. Obviously C(1, 0) = C(1, 1) = 1
are both integers. As are C(2, 0) = C(2, 2) = 1 and C(2, 1) = 2. Let
us assume that C(n, k) is an integer for all 1 n N 1 and for
(N 1)!
0 k n. This implies that C(N 1, k 1) = (k1)!(N
and
k)!
(N 1)!
C(N 1, k) = k!(N
are integers for 1 k N 1. So their sum
k1)!
is also an integer. But, by the previous problem, their sum is C(N, k).
So C(N, k) is also an integer for all 1 k N 1. To complete
the induction, we notice that C(N, 0) = C(N, N ) = 1 which are also
integers. Thus C(n, k) is an integer for all 1 n N and 0 k n.
So by induction, C(n, k) is an integer for all 1 n and 0 k n.
10