Is there $n$ such that $n,n^2,n^3$ start with the same digit ($\neq 1)$

236 Views Asked by At

From the 2015 Moscow Mathematical Olympiad:

Is there some $n>2$ such that $n,n^2$ and $n^3$ start with the same digit (this digit being different from $1$)

Using a computer I found that $99$ fits the bill, but I'm wondering how this can be solved using only pen and paper.

I can't relate the decimal expansion of $n$ to that of $n^2$ and $n^3$ in the general case. Any ideas ?

Also, is it possible to find all such $n$'s ?

4

There are 4 best solutions below

3
On BEST ANSWER

In general positive integers $10^n - k$ for small $k$ are good candidates, as

$$(10^n - k)^2 \qquad \textrm{and} \qquad (10^n - k)^3$$ are not much smaller (proportionately) than $10^{2n}$ and $10^{3n}$ and so (for suitable $n, k$) have leading digit $9$.

Since (for positive $\alpha, m$) $$(1 - \alpha)^m \geq 1 - \alpha m ,$$ we have that $$(10^n - k)^3 \geq 10^{3n} - 3 \cdot 10^{2n} k.$$ If this is at least $10^{3n} - 10^{3n - 1}$, or equivalently, if $$k \leq \frac{1}{3} \cdot 10^{n - 1} ,$$ then $(10^n - k)^3$ has last digit $9$. To conclude that $10^n - k$ has the desired property, we must also show that $(10^n - k)^2$ also has leading digit $9$, but this is not hard to check. For $k = 2$, this leads to $97, 98, 99$.

If $n$ begins with $2$, it is $2 \cdot 10^m \leq n < 3 \cdot 10^m$ for some integer $m$, so $4 \cdot 10^{2m} \leq n^2 < 9 \cdot 10^{2m}$ and hence $n^2$ cannot have leading digit $2$. One can similarly eliminate $3, \ldots 8$ (treating $8$ requires also looking at the cube, $n^3$), so $9$ is the only possible leading digit of such a number.

3
On

It is a bit unfortunate that I already saw that one answer would be 99, but it would probably one of my guesses since $99, 99^2, 99^3$ are very close to respectively $100, 100^2, 100^3$, so they would all start with the same digit, 9.

For example, if one had to find an $n$ where the first two digits of $n, n^2, n^3$ are the same, 999 would work, since they are all three even closer to $1000, 1000^2, 1000^3$.


Here is a list of numbers I found just by using this logic: 97, 98, 99, 966, 967, 968, 969, ... 997, 998, 999, 9655, 9656, ... , 9998, 9999, ...

In general, any number $k$ with $n$ digits such that $k > 10^n \cdot \sqrt[3]{0.9}$ works.

Note that $\sqrt[3]{0.9} \approx 0.96549$. This also means that there are infinitely many, and that they take about 3.5% of the positive integers.

I suspect that this are all such numbers.

0
On

In front of the ranges of fractional numbers starting with a given digit, we indicate the possible initial digits of the squares. [I also considered the solutions starting with a $1$, for completeness.]

$$\begin{align} [1,2)&\to[1,4):&\color{green}1,2,3\\ [2,3)&\to[4,9):&4, 5, 6, 7, 8\\ [3,4)&\to[9,16):&9,1\\ [4,5)&\to[16,25):&1,2\\ [5,6)&\to[25,36):&2,3\\ [6,7)&\to[36,49):&3,4\\ [7,8)&\to[49,64):&4,5,6\\ [8,9)&\to[64,81):&6,7,\color{green}8\\ [9,10)&\to[81,100):&8,\color{green}9\end{align}$$

Among the remaining possibilities, we look at the cubes

$$\begin{align} [1,2)&\to[1,8):&\color{green}1,2,3,4,5,6,7\\ [8,9)&\to[512,729):&5, 6,7\\ [9,10)&\to[729,1000):&7,8,\color{green}9\end{align}$$

This proves that the starting digit must be a [$1$ or] a $9$. Then

$$[1\le x<2\land 1\le x^2<2\land 1\le x^3<2]$$ or $$9\le x<10\land 90\le x^2<100\land 900\le x^3<1000$$ occurs for all

$$[1\le x<\sqrt[3]{2}=1.25992\cdots]$$ or $$\sqrt[3]{900}=9.65489\cdots\le x<10.$$

Example solutions are

$$[n=125992,n^2=15873984064,n^3=1999995000191488,]$$ $$n=965490,n^2=932170940100,n^3=900001720957149000.$$

1
On

Let $n$ be an integer, and let \begin{align} m_1 &= \{\log_{10}(n)\}, \\ m_2 &= \{\log_{10}(n^2)\}, \text{ and}\\ m_3 &= \{\log_{10}(n^3)\}, \end{align} where $\{x\}$ denotes the fractional part of $x$.

Suppose $n$ and $n^2$ start with the same digit $d$ in decimal notation, $d \geq 2$. Define $g(d) = \log_{10}(d+1) - \log_{10}(d)$. Then \begin{gather} \log_{10}(d) \leq m_1 < \log_{10}(d+1), \\ \log_{10}(d) \leq m_2 < \log_{10}(d+1), \\ \lvert m_1 - m_2 \rvert < g(d). \end{gather}

Note that $g(d) = \log_{10}\left(\frac{d+1}{d} \right) = \log_{10}\left( 1 + \frac1d \right) \leq \log_{10} \frac32.$

Either $m_2 = 2m_1$ or $m_2 = 2m_1 - 1$, so one of the following must hold: \begin{align} g(d) > \lvert m_1 - m_2 \rvert &= \lvert m_1 - 2m_1 \rvert = m_1, \tag 1\\ g(d) > \lvert m_1 - m_2 \rvert &= \lvert m_1 - (2m_1 - 1) \rvert = 1 - m_1. \tag 2 \end{align}

But since $d \geq 2$, $m_1 \geq \log 2 > \log \frac32 \geq g(d)$, so $(1)$ is false and $(2)$ must be true. From $(2)$ we get \begin{gather} 1 - \log_{10}(d+1) \leq 1 - m_1 < g(d) = \log_{10}(d+1) - \log_{10}(d), \\ 1 < 2\log_{10}(d+1) - \log_{10}(d) = \log_{10}\left( \frac{(d+1)^2}{d} \right),\\ 10 < \frac{(d+1)^2}{d} = \frac{d^2+2d+1}{d} = d + 2 + \frac1d < d + 3. \end{gather} Therefore $d > 7$, $d \geq 8$ and $m_1 \geq \log_{10} 8$.

From the requirement that $n^3$ also have the same leading digit $d$, \begin{gather} \log_{10}(d) \leq m_3 < \log_{10}(d+1), \\ \lvert m_1 - m_3 \rvert < g(d). \end{gather} Moreover, $m_3$ is one of $3m_1$, $3m_1 - 1$, or $3m_1 - 2$, so one of the following must hold: \begin{align} g(d) > \lvert m_1 - m_3 \rvert &= \lvert m_1 - 3m_1 \rvert = 2m_1, \tag 3\\ g(d) > \lvert m_1 - m_3 \rvert &= \lvert m_1 - (3m_1 - 1) \rvert = \lvert 1 - 2m_1\rvert, \tag 4\\ g(d) > \lvert m_1 - m_3 \rvert &= \lvert m_1 - (3m_1 - 2) \rvert = 2 - 2m_1. \tag 5 \end{align}

We previously found that $g(d) \not> m_1$, so $(3)$ is false. Since $m_1 \geq \log_{10} 8$, $2m_1 - 1 \geq \log_{10} (8^2) - 1 = \log_{10} 6.4 > \log \frac32 \geq g(d)$, so $(4)$ is false and $(5)$ must be true. Then \begin{gather} 2 - 2\log_{10}(d+1) \leq 2 - 2m_1 < g(d) = \log_{10}(d+1) - \log_{10}(d), \\ 2 < 3\log_{10}(d+1) - \log_{10}(d) = \log_{10}\left( \frac{(d+1)^3}{d} \right),\\ 100 < \frac{(d+1)^3}{d} = \frac{d^3+3d^2+3d+1}{d} = d^2 + 3d + 3 + \frac1d < \left(d + \frac32\right)^2 + 4, \\ d > \sqrt{96} - \frac32 > 9.8 - \frac32 = 8.3. \end{gather} We conclude that if such an $n$ exists, $d = 9$. To prove that such a number does exist, notice that $99^2 = 9801$ and $99^3 = 970299$.


How important is each of the assumptions?

For example, what if we did not require that $n^3$ have the same first digit as $n$ and $n^2$? Recall that merely by assuming that $n$ and $n^2$ have the same leading digit $d$, $d > 2$, we showed that $d > 8$. Observing that $8999^2 = 80982001$ and $99^2 = 9801$, we can conclude that the first digit must be $8$ or $9$ under this assumption, but can be either.