Do you know that 1210 is the smallest autobiographical number? You probably do not know what an autobiographical number is. You are right if you think that such a number should be a pompous self-centered number whose only purpose in life is to describe itself.
Here is the formal definition. An autobiographical number is a number N such that the first digit of N counts how many zeroes are in N, the second digit counts how many ones are in N and so on. In our example, 1210 has 1 zero, 2 ones, 1 two and 0 threes.
Let us find all autobiographical numbers using the “zoom-in” method.
- By definition, the autobiographies can’t have more than 10 digits. It is nice to know that these egotistical numbers can’t be too grand.
- The sum of the digits in an autobiography equals the number of the digits. Consequently, the sum of the digits will not be more than 10.
- The first digit is the number of zeroes. As you know, self-respecting integers do not start with a zero. Hence, the number of zeroes is not a zero.
- Subtracting statement “c” from statement “b” above, we get a resulting statement that the sum of all the digits, except for the first one, is equal to the number of non-zero digits plus 1.
- That means, other than the first digit, the set of all other non-zero digits consists of several ones and 1 two.
- Furthermore, the number of ones is either 0, 1 or 2.
Now we continue zooming in in three different directions depending on the number of ones. In this blog entry, I will consider only the case in which there are no ones; I leave the other two cases to the reader.
- If the number of ones is zero, then the only non-zero non-first digit of such a number is 2.
- This 2 should be included in the autobiography; since the third digit of the number is not zero, it must be 2.
- The number has 2 twos.
- It must be 2020.
Here is the full set of autobiographical numbers: 1210, 2020, 21200, 3211000, 42101000, 521001000, 6210001000.
This is the sequence A104786 in the Online Encyclopedia of Integer Sequences (OEIS). The OEIS, where I first encountered the autobiographical numbers.
Autobiographical numbers are very cute numbers. But there is a problem with their name. If there is a notion of an autobiography of a number, then it would be logical to expect that there is a notion of a biography of a number. What would be the logical candidate for a biography of a number? Let us say that given a number N, its biography is another number M such that the first digit of M is the number of zeroes in N, the second digit of M is the number of ones in N and so on.
Of course, for a number to have a biography, we need to assume that none of its digit is present more than nine times. Still there are several problems with the definition of a biography.
The first problem is that if N doesn’t have zeroes, its biography starts with a zero. As numbers don’t start with 0, that biography is not a number! Furthermore, if N starts with 0, it can have a biography but N is not a number. Luckily for this article, a digit string starting with zeroes can’t be an autobiographical string, because the number of zeroes is not a zero. It is a relief that those illegitimate strings that are trying to pretend to be numbers can’t actually be autobiographical.
The second problem with biographies is that a number can have many biographies. Indeed, if a number doesn’t have nines, you can remove or add zeroes at the end of a biography to get another biography of the same number. Since mathematicians like to define things uniquely, we might consider it a problem if a number has several biographies. In real life it is possible to have many biographies of a person. So the second problem is not a big problem. I will call the shortest possible biography of a number the curriculum vitae and the longest possible biography the complete life story.
The third problem is that numbers with the same digits in different permutations have the same biographies. So in a sense a biography follows the life not of a number, but rather the set of its digits.
Suppose for now we allow a biography to start with 0. Also, let us choose the curriculum vitae — the shortest biography in case there could be several. Let us build a sequence of CVs. As an example, we start with 0. Zero’s CV is 1, one’s CV is 01, continuing that we get the following sequence: 0, 1, 01, 11, 02, 101, 12, 011, 12, 011, 12, …. You can see that the CVs’ sequence fell into a cycle in this case. I tried sequences of CVs starting with many numbers. I found that they fall into two cycles. One cycle is described above and another one is: 22, 002, 201, 111, 03, 1001, 22. Can you find another cycle or, alternatively, can you prove that all the numbers that allow the sequence of CVs converge to only these two cycles?
Let us build the sequence of complete biographies, that is, life stories, starting with 0: 0, 1000000000, 9100000000, 8100000001, 7200000010, 7110000100, 6300000100, 7101001000, 6300000100, …. We see that this sequence falls into a cycle of length two. The members of this cycle are legitimate numbers. These numbers are too shy to advertise themselves. But Alice praises Bob, because Bob praises Alice. It’s a very advantageous flattery pattern! I will call such a pair a mutually-praising pair. We’ve already seen mutually-praising strings: 12 and 001. Two other examples of number pairs thriving on each others’ compliments are, first, 130 and 1101, and second, 2210 and 11200.