5
$\begingroup$

For any given pairs of positive integers $a$ and $b$, is it possible that the first digit of $a^n$ never matches the first digit of $b^n$ for any positive integer $n$?

(If $a=2$ and $b=5$ the only possible matching first digit is "3".)

Edit: I meant to say $a=2$ in the parenthetical comment above. I had previously written $a=3$, which does not work as several comments indicate.

  • 0
    @Fixee: I have edited your post so that the first sentence makes mathematical sense. If this is not what you meant, please let me know.2011-05-31
  • 3
    @Fixee: How do you get the result in your last sentence? It surprises me.2011-05-31
  • 2
    And in fact it surprises my laptop too, which insists that $3^9=19683$ and $5^9=1953125$.2011-05-31
  • 0
    $3^9=19683$, $5^9=1953125$. Did I misunderstand the question?2011-05-31
  • 0
    @TonyK beat me to it by 13 seconds!2011-05-31
  • 5
    Not a proof, but you are just looking for $\left(\frac{b}{a}\right)^n\approx 10^m$ You can get this very close taking $m\approx k\log_{10}\frac{b}{a}$ for some $m,k$. I would be very surprised if you always miss.2011-05-31
  • 0
    @Fixee: Presumably we don't want $a=0$! Apart from that, no, it is not possible. Ross Millikan's observation is not hard to turn into a proof.2011-05-31
  • 2
    In view of user6312's comment to Alon Amit's answer below, $a=3$ may just be a typo for $a=2$.2011-05-31
  • 0
    @TonyK, Alon: Sorry I meant $a=2$ not $a=3$ in my example. (I see TonyK realized this a few hours ago.) Apologies for the sloppiness.2011-06-01
  • 0
    @TonyK I added a proof of my last sentence as an answer... pls see below.2011-06-02

2 Answers 2

6

I was also thinking along the lines of Ross Millikan's comment. The first digit (in base 10) of $a^n$ is determined by the fractional part of $\log_{10}(a)$; specifically, the interval $[0,1]$ is partitioned into buckets $[0,\log_{10}(2)), [\log_{10}(2), \log_{10}(3))$, etc. The first digit of $a^n$ and $b^n$ would be the same of $n\log(a)$ and $n\log(b)$ fall into the same bucket, which would follow from the fractional part of $m\log(a/b)$ being smaller than the smallest bucket for some $m$, which means either $m$ or $m+1$ would do the trick.

Now $\log_{10}(a/b)$ is irrational except if $a/b$ is a power of 10, but in the latter case the result is obvious. For an irrational quantity, the fractional parts are dense in the unit interval and the result follows from the considerations above.

  • 0
    Apart from $a$ or $b$ being powers of $10$, the only unusual case is when $ab$ is a power of $10$. Then the only common first digit is $3$.2011-05-31
  • 0
    I think that if $a$ is not a rational power of $b$ then $\{\log a\},\{\log b\}$ are asymptotically independent.2011-05-31
  • 0
    The difficult thing is to prove that even though $\left(\frac{a}{b}\right)^n$ is very close to a power of $10, a^n$ and $b^n$ don't fall just on opposite sides of a bucket boundary. We "know" it is true, but I don't see an easy proof.2011-05-31
  • 6
    If there is no relation $a^i b^j 10^k = 1$ for integers $i$, $j$, $k$, then $\log_{10}(a), \log_{10}(b), 1$ are linearly independent over the rationals, and then the sequence of pairs $(\{n \log a\}, \{n \log b\})$ is uniformly distributed in $[0,1]^2$. See e.g. http://www.maths.manchester.ac.uk/~cwalkden/ergodic-theory/lecture07.pdf.2011-06-01
2

I'm not answering the question, but justifying the claim in the last sentence of the question: when $a=2$ and $b=5$ the only shared leading digit of $a^n$ and $b^n$ is 3.

Suppose $2^n$ and $5^n$ share leading digit $d$ and have $r+1$ and $s+1$ digits, resp. For $n>3$ we have $d10^r < 2^n < (d+1)10^r$ and $d10^s < 5^n < (d+1)10^s$. Therefore $d^2 10^{r+s} < 10^n < (d+1)^2 10^{r+s}$ so $d^2 < 10^{n-r-s} < (d+1)^2$. Since $d$ is a digit, $d \geq 1$ and $(d+1) \leq 10$; these restrictions force $n-r-s = 1$, so $d^2 < 10 < (d+1)^2$ meaning only $d=3$ works. And since $2^5 = 32$ and $5^5 = 3125$ it does in fact occur as a leading digit.