5. A positive integer $N$ is piquant if there exists a positive integer $m$ such that if $n_{i}$ denotes the number of digits in $m^{i}$ (in base 10), then $n_{1}+n_{2}+\cdots+n_{10}=N$. Let $p_{M}$ denote the fraction of the first $M$ positive integers that are piquant. Find $\lim _{M \rightarrow \infty} p_{M}$.
Answer:
$\frac{32}{55}$
Solution: For notation, let $n_{i}(m)$ denote the number of digits of $m^{i}$ and $N(m)=n_{1}(m)+n_{2}(m)+$ $\cdots+n_{10}(m)$. Observe that $n_{i}(10 m)=n_{i}(m)+i$ so $N(10 m)=N(m)+55$. We will determine, for $k \rightarrow \infty$, how many of the integers from $N\left(10^{k}\right)$ to $N\left(10^{k+1}\right)-1$, inclusive, are piquant.
Increment $m$ by 1 from $10^{k}$ to $10^{k+1}$. The number of digits of $m^{i}$ increases by one if $m^{i}<10^{h} \leq$ $(m+1)^{i}$, or $m<10^{\frac{h}{i}} \leq m+1$ for some integer $h$. This means that, as we increment $m$ by 1 , the sum $n_{1}+n_{2}+\cdots+n_{10}$ increases when $m$ "jumps over" $10^{\frac{h}{2}}$ for $i \leq 10$. Furthermore, when $m$ is big enough, all "jumps" are distinguishable, i.e. there does not exist two $\frac{h_{1}}{i_{1}} \neq \frac{h_{2}}{i_{2}}$ such that $m<10^{h_{1} / i_{1}}<10^{h_{2} / i_{2}} \leq m+1$.
Thus, for large $k$, the number of times $n_{1}(m)+n_{2}(m)+\cdots+n_{10}(m)$ increases as $m$ increments by 1 from $10^{k}$ to $10^{k+1}$ is the number of different $10^{\frac{h}{2}}$ in the range $\left(10^{k}, 10^{k+1}\right.$. If we take the fractional part of the exponent, this is equivalent to the number of distinct fractions $0<\frac{j}{i} \leq 1$ where $1 \leq i \leq 10$. The number of such fractions with denominator $i$ is $\varphi(i)$, so the total number of such fractions is $\varphi(1)+\varphi(2)+\cdots+\varphi(10)=32$.
We have shown that for sufficiently large $k, N\left(10^{k+1}\right)-N\left(10^{k}\right)=55$ and exactly 32 integers in the range $\left[N\left(10^{k}\right), N\left(10^{k+1}\right)\right)$ are piquant. This implies that $\lim _{M \rightarrow \infty} p_{M}=\frac{32}{55}$.