8

Find the smallest $n$ such that the digits in $2^n$ have every digit from $1$ to $9$.

Like, the smallest power of $2$ that it has every digits from $1$ to $9$, excluding $0$.

Is there a way to do this without "brute force"?

Ken
  • 135
  • 6
    I would be shocked if this could be done any more efficiently than trying successive powers of 2 (beginning with $2^{27}$ which has 9 digits). On the other hand, one can show without brute force that there exists such an $n$ (indeed there is an $n$ such that $2^n$ starts with $123456789$). Also, $2^{29}$ comes really close but has a $0$ instead of a $4$. – Erick Wong Aug 05 '13 at 03:22
  • 1
    @ErickWong How can one show without brute force that there exists such an $n$? – Fixed Point Aug 05 '13 at 03:34
  • 2
    @FixedPoint: It boils down to the fact that $\log 2$ (to base $10$) is irrational, and therefore the sequence of fractional parts of $n \log 2$ is dense in $[0, 1]$. See this question for instance. (In more detail, for $2^n$ to start with $123456789$, we need that for some $k$, we have $123456789(10^k) \le 2^n < (123456789+1)10^k$, which means that $\log(123456789) \le n\log 2 - k < \log(123456789+1)$.) – ShreevatsaR Aug 05 '13 at 04:02
  • 1
    @FixedPoint To prove that it is sufficient to show that $k \mod \log_2 10 \in [\log_2 1.23456789, \log_2 1.2345679)$ for some $k$. This is the case since $\log_2 10$ is irrational. – Yury Aug 05 '13 at 04:03
  • Is there a standard definition of "brute force"? Maybe we can claim that there's something clever about doubling decimal digits rather than multiplying them by any other constant. Doubling 1024 obviously produces another number with four distinct digits because 0,1,2,and 4 are all in the lower half of the decimal digits. – minopret Aug 05 '13 at 06:11
  • 2
    I don't think there is too much point in insisting a non-brute force approach in this case. For a random $N$ digit number, a rough upper bound of probability that it doesn't contain all digits is $10 (0.9)^N$. This number starts to drop below 1 at $N = 22$. Since $2^n$ contains $\lfloor n \log_{10}2\rfloor + 1 \sim 0.3 n$ digits. We should expect to find $2^n$ which uses all digit for $n$ not too far away from $22/0.3 \sim 70$. As the other answer demonstrate, $2^{51}$ already contains all digits. – achille hui Aug 05 '13 at 07:09

1 Answers1

0

$$ 2^{51} = 2251799813685248 $$