MathDB
self-descriptive number in base b

Source: VJIMC 2009 2.1

June 12, 2021
Basesnumber theory

Problem Statement

A positive integer mm is called self-descriptive in base bb, where b2b\ge2 is an integer, if
i) The representation of mm in base bb is of the form (a0a1ab1)b(a_0a_1\ldots a_{b-1})_b (that is m=a0bb1+a1bb2++ab2b+ab1m=a_0b^{b-1}+a_1b^{b-2}+\ldots+a_{b-2}b+a_{b-1}, where 0aib10\le a_i\le b-1 are integers). ii) aia_i is equal to the number of occurences of the number ii in the sequence (a0a1ab1)(a_0a_1\ldots a_{b-1}).
For example, (1210)4(1210)_4 is self-descriptive in base 44, because it has four digits and contains one 00, two 11s, one 22 and no 33s.