Self-descriptive number
In mathematics, a self-descriptive number is an integer m in a given base b that is b digits long, and each digit d at position n (the most significant digit being at position 0 and the least significant at position b−1) counts how many instances of digit n are in m.
Example
[edit]For example, in base 10, the number 6210001000 is self-descriptive[1] for the following reasons:
In base 10, the number has 10 digits, indicating its base;
It contains 6 at position 0, indicating that there are six 0s in 6210001000;
It contains 2 at position 1, indicating that there are two 1s in 6210001000;
It contains 1 at position 2, indicating that there is one 2 in 6210001000;
It contains 0 at position 3, indicating that there is no 3 in 6210001000;
It contains 0 at position 4, indicating that there is no 4 in 6210001000;
It contains 0 at position 5, indicating that there is no 5 in 6210001000;
It contains 1 at position 6, indicating that there is one 6 in 6210001000;
It contains 0 at position 7, indicating that there is no 7 in 6210001000;
It contains 0 at position 8, indicating that there is no 8 in 6210001000;
It contains 0 at position 9, indicating that there is no 9 in 6210001000.[2]
In different bases
[edit]There are no self-descriptive numbers in bases 2, 3 or 6. In bases 7 and greater, there is exactly one self-descriptive number: , which has b−4 instances of the digit 0, two instances of the digit 1, one instance of the digit 2, one instance of digit b – 4, and no instances of any other digits. The following table lists some self-descriptive numbers in a few selected bases:
Base | Self-descriptive numbers (sequence A138480 in the OEIS)[3] | Values in base 10 (sequence A108551 in the OEIS)[4] |
---|---|---|
4 | 1210 2020 |
100 136 |
5 | 21200 | 1,425 |
7 | 3211000 | 389,305 |
8 | 42101000 | 8,946,176 |
9 | 521001000 | 225,331,713 |
10 | 6210001000 | 6,210,001,000 |
11 | 72100001000 | 186,492,227,801 |
12 | 821000001000 | 6,073,061,476,032 |
... | ... | ... |
16 | C210000000001000 | 13,983,676,842,985,394,176 |
... | ... | ... |
36 | W21000000000000000000000000000001000 | 94,732,999,538,876,093,602,890,439,603,390,793,851,493,346,239,336,986,176 |
... | ... | ... |
Properties
[edit]All self-descriptive numbers share several properties that can be formally proven for any base b for which such numbers exist (b ≥ 4, b ≠ 6).[5]
Sum of digits
[edit]The sum of the digits of any self-descriptive number in base b is equal to b. This follows directly from the definition: the digits d0, d1, ..., db−1 act as a tally of how many times each corresponding digit value (0, 1, ..., b−1) appears in the number. Since there are a total of b digits in the number, the sum of these tallies must be b.[5]
A related identity, which is crucial for proving other properties, is that the sum of the digits weighted by their own value is also equal to b:[5]
Divisibility
[edit]Every self-descriptive number is a multiple of its base b. This is equivalent to stating that its last digit, db−1, must be 0.
A proof by contradiction can be formulated as follows: assume the last digit, db−1, is at least 1. This means the digit b−1 appears in the number at least once. Let this digit b−1 occur at position x. By definition, this implies that the digit x must appear b−1 times.
- If x > 1, the number would contain b−1 instances of the digit x and at least one instance of the digit b−1, resulting in more than b total digits, which is a contradiction.
- If x is 0 or 1, a similar contradiction arises.[5]
A more direct proof using the weighted sum identity shows that if db−1 were 1 or greater, the single term (b−1)db−1 would, by itself, be greater than or nearly equal to the required total sum b, leading to a contradiction once other non-negative terms are added.[5]
It follows that a self-descriptive number in base b is a Harshad number, as its value is divisible by the sum of its digits (which is b).[5]
Primality
[edit]No self-descriptive number can be a prime number.
This is a direct result of the divisibility property. Let M be the value of a self-descriptive number in base b.
- From the property above, M is divisible by b.
- For M to be prime, its only divisors can be 1 and M.
- However, for all bases where self-descriptive numbers exist (b ≥ 4), the base b is greater than 1.
- The value M is always strictly greater than b, as M is a b-digit number with a non-zero leading digit, making its value at least bb-1.
Since b is a divisor of M such that 1 < b < M, M must be a composite number.[5]
Structural constraints
[edit]Self-descriptive numbers are structurally constrained and sparse, meaning they are composed mostly of zeros.
- The leading digit, d0, which counts the number of zeros, can never be zero. If d0 were 0, it would state there are no zeros in the number, contradicting itself.[5]
- For any base, a self-descriptive number can have at most four non-zero digits.[5]
For all bases b ≥ 7, the self-descriptive number has a fixed and unique structure:[5]
- d0 = b − 4
- d1 = 2
- d2 = 1
- db−4 = 1
- All other digits are 0. (i.e., di = 0 for i ∈ {3, ..., b−1} \ {b−4})
Autobiographical numbers
[edit]A generalization of the self-descriptive numbers, called the autobiographical numbers, allow fewer digits than the base, as long as the digits that are included in the number suffice to completely describe it. e.g. in base 10, 3211000 has 3 zeros, 2 ones, 1 two, and 1 three. Note that this depends on being allowed to include as many trailing zeros as suit, without them adding any further information about the other present digits.[6]
Because leading zeros are not written down, every autobiographical number contains at least one zero, so that its first digit is nonzero.
Considering a hypothetical case where the digits are treated in the opposite order: the units is the count of zeros, the 10s the count of ones, and so on, there are no such self-describing numbers. Attempts to construct one result in an explosive requirement to add more and more digits.[citation needed]
References
[edit]- ^ Weisstein, Eric W. "Self-Descriptive Number". MathWorld.
- ^ Pickover, Clifford (1995). "Chapter 28, Chaos in Ontario". Keys to Infinity. New York: Wiley. pp. 217–219. ISBN 978-0471118572.
- ^ Sloane, N. J. A. (ed.). "Sequence A108551 (Self-descriptive numbers in various bases)". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation.
- ^ Sloane, N. J. A. (ed.). "Sequence A046043 (Autobiographical numbers)". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation.
- ^ a b c d e f g h i j Brunori, Davide (2025). "On the Properties of Self-Descriptive Numbers: Divisibility, Primality, and Structural Constraints". Zenodo. doi:10.5281/zenodo.16697581.
- ^ Khovanova, Tanya (2008), Autobiographical Numbers, arXiv:0803.0270
External links
[edit]- Khovanova, Tanya (23 August 2018). "Can You Solve the Leonardo da Vinci Riddle?". Lesson about autobiographical numbers. TED-Ed.