# Autobiographical numbers

An autobiographical number is a number that describes its own digits. The first digit (from left) specifies the number of 0s in the number, the next digit specifies the number of 1s in the number and so on. For example 2020 is an autobiographical number, because it contains two 0s, zero 1s, two 2s and zero 3s. What is the next autobiographical number after 2020?

21200

Step-by-step analysis:

There are no other autobiographical numbers in the form of 2xxx: Since we already have a 2, the two zeros must go to 1s and 3s. This just leads to the number 2020 which does not meet the condition (after 2020).

There are no other four-digit autobiographical numbers higher than that: 3xxx is impossible because we have a three, so the last digit is nonzero, and then there's not enough space to put three zeros. 4xxx or higher is obviously impossible.

There are no five-digit autobiographical numbers in the form of 1xxxx: There are only one zero, so we have at least three distinct digits out of 1234. But the minimum sum of the three digits is 1+2+3=6, so it does not fit into five digits.

21200 is the only autobiographical number in the form of 2xxxx: There must be two zeros, and the 2 position is nonzero. Due to the same digit sum argument, threes and fours must be zero, giving 2xx00. The only possible nonzero 2-digit combination that sums to 3 is 12, so there are two 2s and one 1. The autobiographical number that matches this is 21200, which has two zeros, one 1, two 2s, no 3s and no 4s.

Trivia:

After I posted the solution, I googled the term and I found that "autobiographical numbers" is a real name for such numbers. And there exists an OEIS sequence A046043 that lists up all autobiographical numbers: 1210, 2020, 21200, 3211000, 42101000, 521001000, 6210001000.

• +1! Just beat me to it :-) Oct 6, 2020 at 1:14