# Prove that powers of any fixed prime $p$ contain arbitrarily many consecutive equal digits.

Prove that powers of any fixed prime $p$ contain arbitrarily many consecutive equal digits.

It is an intuitive re-statement of Baltic Way 2012 (I think there are shortlists in Baltic Way every year and this is a part of the 2012 shortlist):

Prove that, for every prime $p$ and positive integer $a$, there exists a positive integer $n$ such that $p^n$ contains $a$ consecutive equal digits.

It is a tough one and I haven't found a solution on the Internet.

• See here – Daniel Fischer May 2 '15 at 14:26
• The fact that $p$ is prime is not really relevant. This holds for any positive integer (powers of $10$ are a bit different, but obviously work). Hey, it is probably true for any positive real number in the place of $p$. – Marc van Leeuwen May 2 '15 at 16:33

Even more is true: the leading digits of $p^n$ can be any sequence you want. Note how $$\text{the leading digits of }p^n\text{ are }\overline m$$ is the same as saying $$\overline m\cdot 10^k\leq p^n<(\overline m+1)\cdot 10^k\text{ for some }k\geq0.$$ Equivalently, $$\log_{10}(\overline m)\leq n\log_{10}(p)-k<\log_{10}(\overline m+1).$$
Indeed there is an infinitude of such $n,k$, because $\log_p(10)$ is irrational and hence the set $\{n\log_p(10)-k\mid n,k\in\mathbb N\}$ is dense in $\mathbb R$. (See this question.)
Now, take for example $\overline m=\underbrace{33\ldots333}_{a\text{ times}}$.