The Proof of the Divisibility Test for 7 and 13
📂Number TheoryThe Proof of the Divisibility Test for 7 and 13
Buildup
In this post, for convenience in discussing number systems, we use the following notation.
[anan−1…a1a0]:=an⋅10n+an−1⋅10n−1+…+a1⋅101+a0⋅100
For example, 5714 can be represented as follows.
[5714]==5000+700+10+45⋅103+7⋅102+1⋅101+4⋅100
Theorem
anan−1an−2−an−3an−4an−5+…+a5a4a3−a2a1a0
If it’s a multiple of 7, then [anan−1…a1a0] is also a multiple of 7,
anan−1an−2−an−3an−4an−5+…+a5a4a3−a2a1a0
If it’s a multiple of 13, then [anan−1…a1a0] is also a multiple of 13.
Explanation
What this means is, if the number obtained by grouping digits in threes and alternately adding and subtracting them is a multiple of 7, then the original number is also a multiple of 7. Let’s understand this with an example.
For instance, looking at 745444, according to the rule,
745−444=7⋅301
it’s a multiple of 7, and indeed 745444 is a multiple of 7 as it is 745444=7⋅106492. Even for a larger number like 11794545, the rule above still applies,
−11+794−545=238=7⋅34
is a multiple of 7, and indeed 11794545 is 11794545=7⋅1684935 which makes it a multiple of 7.
This theorem holds true for the case of 13 as well, and actually also for the case of 11. The reason is because the multiple determination rule for 7, 11, and 13 all come from the same proof. Merely changing the numbers results in exactly the same proof, so we will omit the case of 11 and 13.
Proof
Strategy: The proof itself uses only very basic techniques, but because it’s inherently lengthy and requires an idea, it’s not easy. A key idea is using the fact that 1001 and 999999 are multiples of 7.
103+1=1000+1=1001=7⋅143(103+1)(103−1)=106−1=1000000−1=999999=7⋅142857
==[anan−1…a1a0][anan−1an−2]10n−2+[an−3an−4an−5]10n−5+…+[a5a4a3]103+[a2a1a0]([anan−1an−2]103+[an−3an−4an−5])10n−5+…+([a5a4a3]103+[a2a1a0])
Focusing only on the part inside the parentheses,
([anan−1an−2]103+[an−3an−4an−5])=[anan−1an−2]103+([anan−1an−2]−[anan−1an−2])+[an−3an−4an−5]=([anan−1an−2]103+[anan−1an−2])−([anan−1an−2]−[an−3an−4an−5])=[anan−1an−2]1001−([anan−1an−2]−[an−3an−4an−5])=[anan−1an−2]7⋅143−([anan−1an−2]−[an−3an−4an−5])
Thus,
([anan−1an−2]−[an−3an−4an−5])
If it’s a multiple of 7,
[anan−1an−2an−3an−4an−5]
is also a multiple of 7.
Let’s now generalize it.
([anan−1an−2]103+[an−3an−4an−5])10n−5=[anan−1an−2]7⋅143⋅10n−5−([anan−1an−2]−[an−3an−4an−5])10n−5
If we group terms like [anan−1an−2]7⋅143⋅10n−5 all together as c,
=[anan−1…a1a0]7c+([anan−1an−2]−[an−3an−4an−5])10n−5+…+([a5a4a3]−[a2a1a0])
Regardless of what c is, since 7c is definitely a multiple of 7, the proof is complete if the latter part is a multiple of 7. And here, the property of 999999 is used.
A106=A106−A+A=(106−1)A+A=999999A+A=7⋅142857A+A=7c+A
Since the above equation holds, the power of 10 will yield a constant term divisible by 7, reducing the degree by 6 each time.
=[anan−1…a1a0]7c+([anan−1an−2]−[an−3an−4an−5])10n−5+…+([a5a4a3]−[a2a1a0])
In the above equation, all instances of n−5,n−11,…,0 are multiples of 6, thus
=[anan−1…a1a0]7c+([anan−1an−2]−[an−3an−4an−5])+…+([a5a4a3]−[a2a1a0])
Therefore,
[anan−1an−2]−[an−3an−4an−5]+…+[a5a4a3]−[a2a1a0]
If it’s a multiple of 7, then [anan−1…a1a0] is also a multiple of 7.
Considering the point of 1001=7⋅143=7⋅11⋅13, whether it’s the case of 11 or 13, the proof is virtually complete.
■