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

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.


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.


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.$$