Skip to content

Latest commit

 

History

History
43 lines (23 loc) · 1.14 KB

p0063.md

File metadata and controls

43 lines (23 loc) · 1.14 KB

[<] [^] | [>]

Problem 63: Powerful Digit Counts

The link to the problem

My approach

Assume that an nth power is $m^{n} \ \ (m, n \in \mathbb{Z} : m &gt; 0, \ n &gt; 0)$ and $n$-digit number.

$$10^{n - 1} \le m^{n} < 10^{n}$$

$$n - 1 \le \log_{10} m^{n} < n$$

$$n - 1 \le n \cdot \log_{10} m < n$$

By $n \cdot \log_{10} m &lt; n$, the upper bound of $m$ can be obtained.

$$ \log_{10} m < 1$$

$$\therefore m < 10$$

By $n - 1 \le n \cdot \log_{10} m$, the upper bound of $n$ can be obtained.

$$\frac{n - 1}{n} \le \log_{10} m$$

$$1 - \log_{10} m \le \frac{1}{n}$$

$$n \le \frac{1}{1 - \log_{10} m}$$

$$\therefore \max (n) = \left\lfloor \frac{1}{1 - \log_{10} m} \right\rfloor$$

The right-hand side can be transformed by using logarithmic formulas as below. But, it's a matter of taste since the important thing is to know the upper bound of $n$.

$$\frac{1}{1 - \log_{10} m} = \frac{1}{\log_{10} \frac{10}{m}} = \log_{\frac{10}{m}} 10$$

Then, the answer is below.

$$\sum_{m=1}^{9} \left\lfloor \frac{1}{1 - \log_{10} m} \right\rfloor$$