5. Given a real number $x$ between 0 and 1, consider its decimal representation $0, c_{1} c_{2} c_{3} \ldots$ We call $B(x)$ the set of different subsequences of six consecutive digits that appear in the sequence $c_{1} c_{2} c_{3} \ldots$

For example, $B(1 / 22)=\{045454,454545,545454\}$.

Determine the minimum number of elements of $B(x)$ as $x$ varies among the irrational numbers between 0 and 1 (i.e., those whose decimal expansion is neither finite nor periodic from a certain point onward.)
SOLUTION: The number sought is seven. To prove this, we will show that (a) there exists an irrational number $x$ such that $B(x)$ has no more than seven elements, and that (b) every real number $y$ such that $B(y)$ has six or fewer elements is rational.

Part (a). Consider a number $x$ constructed as follows. The first digit in the decimal expansion of $x$ is a 1, followed by five zeros, then another 1, followed by six zeros, then another 1 followed by seven zeros, and so on, with the decimal expansion of $x$ consisting of 1s interspersed with sequences of zeros of increasing length. Clearly,

$$
B(x)=\{000000,000001,000010,000100,001000,010000,100000\}
$$

Moreover, $x$ is irrational. Indeed, if $x$ were rational, then from a certain digit onward, say the $k$-th, its decimal expansion would be periodic. Let $l$ be the length of the period. Since the expansion of $x$ contains infinitely many sequences of zeros of length greater than $2l$, one of these would occur after the $k$-th digit and would contain a complete period. This implies that the period would consist of $l$ zeros, which contradicts the fact that the expansion of $x$ contains infinitely many 1s.

Part (a), alias. Let $[x]_{i}$ denote the $i$-th digit after the decimal point of a number $x$ between 0 and 1. Consider any irrational number $\alpha$ in this interval, for example, $\alpha=\sqrt{2} / 2$. For $i=1 \ldots 6$ and $j=0 \ldots 9$, define the numbers $\alpha_{i, j}$ as follows:

$$
\left[\alpha_{i, j}\right]_{k}= \begin{cases}1 & \text { if } k=6 n+i \text { for some } n \text { and }[\alpha]_{k}<j \\ 0 & \text { otherwise }\end{cases}
$$

By summing these numbers column-wise, it is clear that, among the $k$-th digits, exactly $[\alpha]_{k}$ are 1, and the rest are 0. Therefore, $\alpha$ is the sum of the $\alpha_{i, j}$. Consequently, at least one of these numbers, which we call $x$, is irrational. On the other hand, the digits of all the $\alpha_{i, j}$ are only zeros and ones, and there is at most one 1 in every six consecutive digits. Thus,

$$
B(x) \subseteq\{000000,000001,000010,000100,001000,010000,100000\}
$$

Part (b). Let $B_{k}(y)$ be the set of subsequences of length $k$ in the decimal expansion of $y$. We will prove by induction on $k$ that if $B_{k}(y)$ has $k$ or fewer elements, then $y$ is rational. This clearly concludes the proof because $B(y)=B_{6}(y)$.

The case $k=1$ is immediate. Suppose we know the statement for $k$ and prove that it holds for $k+1$. We will rely on the fact that every subsequence of length $k+1$ in the digits of $y$ starts with a subsequence, which we call corresponding, of length $k$. Conversely, given a subsequence of length $k$, it must correspond to at least one subsequence of length $k+1$. Therefore, in particular, $B_{k}(y)$ has no more elements than $B_{k+1}(y)$. Fix $y$ and study the number of elements in $B_{k}(y)$. If this number is $k$ or fewer, the statement follows from the case $k$. On the other hand, the number of elements in $B_{k}(y)$ cannot exceed $k+1$, otherwise $B_{k+1}(y)$ would also have more than $k+1$ elements, contrary to the hypothesis. Therefore, we can assume that both $B_{k}(y)$ and $B_{k+1}(y)$ have exactly $k+1$ elements. The correspondence described above is thus bijective. In other words, each digit following the $k$-th in the expansion of $y$ is uniquely determined by the preceding $k$ digits. Since there are $k+1$ possible subsequences of $k$ digits, there must exist $i$ and $j$ such that $i<j$ and the $k$ digits in the decimal expansion of $y$ following the $i$-th coincide with the $k$ digits following the $j$-th. Then the entire expansion following the $i$-th digit must coincide with the expansion after the $j$-th. This means that the digits between the $i$-th (exclusive) and the $j$-th (inclusive) repeat periodically, so $y$ is rational.