4. (20 points) Let the set $\boldsymbol{A}$ consist of all three-, five-, seven-, and nine-digit numbers, in the representation of which the decimal digits $1,2, \ldots, n$ (not necessarily distinct) are used, and the set $\boldsymbol{B}$ - of all two-, four-, six-, and eight-digit numbers, in the representation of which the decimal digits $1,2, \ldots, m$ (not necessarily distinct) are used. For which $m$ will the number of elements in $\boldsymbol{B}$ be no less than in $\boldsymbol{A}$, if $n=6$?
Answer: $m=8$ or $m=9$.

Solution: The number of numbers in set $\boldsymbol{A}$ is $6^{3}+6^{5}+6^{7}+6^{9}=1036624$. The number of numbers in set $\boldsymbol{B}$ is $N_{m}=m^{2}+m^{4}+m^{6}+m^{8}$ and $N_{m}$ increases with the increase of $m$.

By direct verification, we find that

$$
N_{7}=58849001036624 .
$$

Thus, $m=8$ and $m=9$ are suitable.