For $0 \leq x$, let $f_{n}(x)=f_{n-1}(x)$; where $f_{n-1}(x)=0$, let the value of $f_{n}(x)$ be $q^{n-1}$ or 0 depending on whether the $n$-th decimal digit of $x$ is 5 or not, where $q$ is a positive number less than 1. Determine the limit of the sequence

$$
a_{n}=\int_{0}^{1} f_{n}(x) d x \quad(n=1,2, \ldots)
$$
First, we show that

$$
f_{n}(x)= \begin{cases}q^{k-1}, & \text { if in the decimal representation of } x \text {, the first } 5 \text { appears at the } k \text {th place and } k \leq n, \\ 0, & \text { if there is no } 5 \text { in the first } n \text { decimal places}\end{cases}
$$

(For numbers that have two decimal representations, we use the finite one, e.g., for $\frac{4}{5}$, we use the $0.800 \ldots$ representation and not the $0.799 \ldots$ representation).

Our statement is true for $n=1$. We will show that if the statement is true for $n$, then it is also true for $(n+1)$. Consider $f_{n+1}(x)$. If $x$ has a 5 in the first $n$ decimal places, then according to (3), $f_{n}(x)>0$, so $f_{n+1}(x)=f_{n}(x)$. If the first 5 is at the $k$th decimal place, then $f_{n+1}(x)=f_{n}(x)=q^{k-1} (k \leq n)$. If the first 5 is at the $(n+1)$th decimal place, then $f_{n+1}(x)=q^{n+1-1}=q^{n}$, since the $(n+1)$th decimal place of $x$ is 5 and $f_{n}(x)$ for this $x$ was 0 due to (1). Finally, if there is no 5 in the first $(n+1)$ decimal places of $x$, then by the induction hypothesis, $f_{n+1}(x)=0$. This proves (3).

The function $f_{n}(x)$, according to the form under (3),

$$
a_{n}=\int_{0}^{1} f_{n}(x) d x=\sum_{k=1}^{n} \alpha_{k} q^{k-1}
$$

where $\alpha_{k}$ is the sum of the lengths of all segments that are parts of the $(0 ; 1)$ interval and for which any point in the segment has a decimal representation where the $k$th decimal place is 5, but none of the preceding ones are.

To determine the $\alpha_{k}$ numbers, divide the $(0 ; 1)$ interval into $10^{k}$ segments of length $\frac{1}{10^{k}}$, each being left-closed and right-open. Selecting any one of these, its left endpoint is of the form $0, b_{1} b_{2} \ldots b_{k} 00 \ldots$, and all numbers within the segment have the same first $k$ decimal places. Thus, it is sufficient to examine the left endpoints of the segments. Since the number of suitable left endpoints is $9^{k-1}$, $\alpha_{k}=\frac{9^{k-1}}{10^{k}}$, so

$$
a_{n}=\int_{0}^{1} f_{n}(x) d x=\sum_{k=1}^{n} \frac{9^{k-1} q^{k-1}}{10^{k}}=\frac{1}{10} \frac{\left(\frac{9}{10} q\right)^{n}-1}{\left(\frac{9 q}{10}\right)-1}
$$

The desired limit is then

$$
\lim _{n \rightarrow \infty} a_{n}=\frac{1}{1-\frac{9 q}{10}} \cdot \frac{1}{10}=\frac{1}{10-9 q}, \quad \text { since } \quad \frac{9 q}{10}<1
$$

Kiss Emil (Budapest, Fazekas M. Gyak. Gimn., III. o. t.)