I like numbers. This is apparent to anyone who knows me well. One of my favourite numbers is the number 9. 9 is a good number, and it has lots of properties which make it lovely. For instance, any multiple of nine has digits which sum to a multiple of nine. Take the number, 27602742108312 has digits which add up to 45, whose digits add up to 9, therefore 27602742108312 is a multiple of 9.
Some years ago, this property intrigued me. I was on a train and fairly bored, so I had a think about it. Why is this true?
If one writes a list of the multiples of 9, you get the following:
Remember your primary school maths lessons? Remember how, when you were being taught about long addition, they spoke about "units, tens, hundreds, thousands"? Well, this is being used here. Every time you add nine to the previous number, if the unit is greater than 0, it is reduced by 1, while 1 is added to the tens. Thus, the numbers balance out, and the sum remains at 9.
But it's not quite that simple. The reason why we count in units, tens, hundreds, and so on is because we use the decimal number system. That is, we count in base 10. It's possible to count in other bases - if you've ever used a tally counting system, that's using base 1. If you understand binary, that's base 2. Hexadecimal is base 16, and so on. Whatever base you're in (let's call it B), the digits in the numbers you use are arranged in a very specific format:
... B5 B4 B3 B2 B1 B0
So, in base 10, we count in:
... 105 104 103 102 101 100
Which works out as:
... 100000 10000 1000 100 10 1
So, if you want to represent the number "35673" in decimal, you're saying you have three ten thousands, five thousands, six hundreds, seven tens and three units. If you are counting in binary, these numbers are:
... 32 16 8 4 2 1
So, if you have the binary number "101101", you're saying you have one thirty-two, no sixteens, one eight, one four, no twos and one one, which is the same as 45 in decimal.
If you are counting in ternary (base 3), your columns are:
...243 81 27 9 3 1
And thus the number "201212" represents two times 243, no eighty-ones, one twenty-seven, two nines, one three and two ones. 486+0+27+18+3+2=536 in decimal.
Whenever we count on our hands, we use each finger to represent a one - we are counting in base 1. However, if we count in base two on our hands, we can get a much larger range of numbers:
Hold your hands in front of you, palms facing you. Put down all your fingers into fists. Imagine that this represents zero. Whenever you raise a finger, that puts a '1' into the number that that finger represents, while a finger being down represents a '0'. (Note that this assumes complete independence of finger movement, which isn't quite true for the ring and little fingers, but it is good enough for a demonstration). Raise your right-hand thumb. This number is therefore 0000000001 in binary, or 1 in decimal. Put your thumb down, and raise your right index finger. This is 0000000010, or 2 in decimal. Raise your thumb again. This is 0000000011, or 3 in decimal. Put both these down and raise your middle finger. Apologise to whoever is now looking at you in a very offended way, and tell them that this is 0000000100, or 4 in decimal. If you keep counting in this way, by the time you get to raise the thumb on your left hand, you've counted all the way up to 512. Raise all your fingers, and this represents 1023. On two hands which you previously thought could only count up to ten.
But all this is a minor distraction. Hopefully, you're now familiar with number bases. Let's say that we have a number base A, where A merely represents any number. If A is 2, we are counting in binary. If A is 10, we are in decimal, and so on. If we take the number A-1, any multiple of A-1 will have digits which sum to A-1. To show this, in senary (number base 6), we count as follows, with senary on the left hand and decimal on the right:
0 - 0
1 - 1
2 - 2
3 - 3
4 - 4
5 - 5
10 - 6
11 - 7
12 - 8
13 - 9
14 - 10
15 - 11
20 - 12
21 - 13
22 - 14
23 - 15
24 - 16
25 - 17
30 - 18
31 - 19
32 - 20
33 - 21
34 - 22
35 - 23
40 - 24
41 - 25
42 - 26
We are counting in base 6, and so I am saying that any multiple of five (6-1, for those not keeping up) will have digits which sum to a multiple of 5. I have highlighted these in bold above. The multiples of 5 in senary are 5, 14, 23, 32, 41, 50, 55, 104, 113, 122, 131, 140, 145, and so on. Each of the sums of these numbers adds to a multiple of five. However, look at that last number: 145. The numbers add up to 10, which is clearly 5 x 2, but these digits don't add up to 5. However, we need to add the numbers in senary, not decimal: 1 + 4 + 5 equals 14 in senary, and these digits add up to 5. This property is true for all bases.
Again, in hexadecimal, the multiples of 15 (represented as F) are: F, 1E, 2D, 3C, 4B, ..., F0, FF, 10E, and so on. For the number FF, the digits in decimal add to 30, which is, again, a multiple of F. In hexadecimal, F + F = 1E, and 1 + E add to F.
I'm now going to generalise this a bit. It gets a bit technical, so bear with me.
Whenever we count in base A, we set up our columns so that, as above, we have
...A5 A4 A3 A2 A 1
We set all the values to zero, and begin incrementing the units column by one. When we get to the number "A", we set the units column to zero and the "A" column to 1. Thus, any number which is smaller than A lies only within the units column. Likewise, any number which is smaller than A2 lies purely within the "A" and units columns, and so on. Similarly, if a number is greater than (A-1), the number must lie in more than just the units column. This is a very important property. Using this property, a table can be constructed showing all of the digits of any multiple of any base A, and their sum:
|N||N x (A-1)||A3||A2||A||1||Digit Sum|
From this table we can see that, at least up to a certain point, all of the multiples of (A-1) have numbers which sum to a multiple of (A-1). I believe that it extrapolates to all multiples of any base. Now, recall that I, at the time, was considering all of this on a train. Rather like Fermat, I came up with a terrifically brilliant explanation for why this was so. But I didn't write it down and now I can't remember. This latter point I put down to old age. Bear in mind also, that I've forgotten much of the mathematics I used in my degree, which is something I intend to remedy at a later date.
Still, the concept is a very interesting one, and it's something that I've not come across elsewhere. If one of my (mumble) readers wants to point me in the direction of an interesting explanation for this from someone else, please do. I've yet to find one.