r/askmath•
Lukecell

Multiples of 7 in Octal

Number Theory

For one of my computer science courses I had to convert things from base 10 into binary, octal, and hexadecimal. While going through the problem sets, I noticed that every multiple of 7's digits add up to another multiple of 7 when represented in octal. For example:

42 in base 10 -> 52 in base 8

84 in base 10 -> 124 in base 8

21 in base 10 -> 25 in base 8

Is this an actual pattern, or just sheer coincidence? If it is a pattern, can this be generalized to other bases? Are there any theorems or lemmas or whatever related to this?

Posted Dec 18, 2023, 6:47 AM UTC

194
MathMaddamDr. in number theory•

You know the divisibility by 9 in base 10? The proof works for divisibility by b-1 in base b.

34
Pielzgraf•

We can prove this inductively:

In base n, 0 will always be a multiple of n-1, so the digits of 0 do indeed sum to a multiple of n-1.

Now suppose you add n-1 to a number which has digits already summing to a multiple of n-1. There are two cases:

The number ended in a 0. Now it ends in n-1 and nothing else changed, so the sum of digits, which used to be a multiple of n-1, is still a multiple of n-1.

The number did not end in 0. This means that we will have to carry over to the n's column. The 1s column will decrease by 1, and the n's column will increase by 1, so the sum is unchanged.

So by induction, multiples of n-1 in base n will have digits summing to a multiple of n-1.

6
CaptainMatticus•

Have you ever noticed how the digits of every multiple of 9 adds up to another multiple of 9 in base-10? It's the same thing happening here.

8 = 7 + 1, right?

52 in base 8 is 5 * (7 + 1) + 2 = 5 * 7 + 5 * 1 + 2 = 5 * 7 + 5 + 2 = 5 * 7 + 7 = 7 * (5 + 1)

We can extend this for all sorts of numbers.

52752 should be divisible by 7 as well.

5 * 8^4 + 2 * 8^3 + 7 * 8^2 + 5 * 8^1 + 2

5 * (7 + 1)^4 + 2 * (7 + 1)^3 + 7 * (7 + 1)^2 + 5 * (7 + 1) + 2

Now, (7 + 1)^4 is just going to expand to some number 7k + 1. Same thing with (7 + 1)^3 , (7 + 1)^2 and (7 + 1). We don't have to actually know what k is.

5 * (7ka + 1) + 2 * (7kb + 1) + 7 * (7kc + 1) + 5 * (7kd + 1) + 2

7 * (5ka + 2kb + 7kc + 5kd) + 5 * 1 + 2 * 1 + 7 * 1 + 5 * 1 + 2

7 * m + 5 + 2 + 7 + 5 + 2

7m + 7 + 7 + 7

7 * (m + 3)

There you go. Not really a proof, but it gives you the concept.

3
vivikto•

Every divisibility rule that works in base 10 has an equivalent in other bases.

Rule 1

In base 10, every multiple of a divisor of 10 (which are 1, 2, 5 and 10), and only them, end with a digit that is itself a multiple of this divisor. For example, a multiple of 5 will end with 0 or 5 as these are the only two digits that are multiples of 5.

In base 12 (the digits are 0, 1, 2, 3, 4, 5, 6, 7 ,8, 9, A, B), it's the same, but with the multiples of 12 (1, 2, 3, 4, 6, 12). For example, a multiple of 4 will end with 0, 4 or 8.

Rule 2

In base 10, every multiple of a divisor of 10-1 (so, all the divisors of 9, which are 1, 3 and 9) will have its digits that add up to a multiple of this divisor. For example, 15 is a multiple of 3, so its digits add up to 6 which is a multiple of 3.

In base 13, every multiple of a divisor of 13-1 (so, all the divisors of 12, which are 1, 2, 3, 4, 6, 12) will have its digits that add up to a multiple of this divisor. For example, 178 in base 13 (which is 268 in base 10) is a multiple of 4, so its digits add up to 16 (in base 10, but 13 in base 13) which is a multiple of 4.

Conclusion

As you can see, the most famous divisibility rules (1, 2, 3, 5, 9, 10) can be sumed up in 2 rules. And these rules apply to any basis.

We could go further and say that it's actually for the same reason that the multiples of 25 are easy to see. It's indeed because we can see the base 10 as a base 100, where 1 digits would be the combination of 2 digits. If we do that, then we can apply the first rule. 25 is a divisor of 100, so the last digit of a number in base 100 (the 2 last digits in base 10) must be a multiple of 25. Which explains why multiples of 25 end with 00, 25, 50 or 75.

2