7

Let $a,b$ be integers $>1$ and consider the values

$$3^a - 2^b $$

I was interested in the smallest possible values this can have.

If we use a greedy method by taking $3^n$ for all integers going from $1$ to $n$ and substract the highest possible power of $2$ from it we get the sequence :

https://oeis.org/A056577

Difference between $3^n$ and highest power of $2$ less than or equal to $3^n$ :

$$0, 1, 1, 11, 17, 115, 217, 139, 2465, 3299, 26281, 46075, 7153,...$$

But we immediately notice this is not even a strictly increasing sequence.

Ordering the sequence we get - assuming there are no huge drops in values to get in between values -

$$ 1,11,17,115,139,217,2465,3299,7153,...$$

I wonder how fast this function grows.

It seems to fit well with an exponential trend for some fixed base. Something like $c d^n$ for some fixed $c,d$. Maybe they relate to $\ln(3)/\ln(2)$ ...

But my main concern here, how do I know there are no in between values ?

So to be more specific I ask the following :

How do I know

$$ 217 < 3^a - 2^b < 2465 $$

has no integer solutions $a,b$ ??

Ofcourse I do not want to solve the set of equations

$$3^a - 2^b = 218$$ $$3^a - 2^b = 219$$

etc one by one.

I am looking for something more efficient.

mick
  • 17,886
  • 3
    I think your question comes from the famous Collatz $3n+1$ Conjecture, which analysis the possible cycles. –  Apr 09 '25 at 11:30
  • 1
    Looks like it wouldn't be too hard to check lots of values. For a in 5 .. { x = 3^a (but progressively); x -= 218; x -= 2^b for the largest b possible (trivial in binary); if x < 2465 - 218 then you found one;} – DanielV Apr 09 '25 at 11:43
  • 3
    FYI, as user1606702's comment indicates, this is related to the Collatz conjecture. In particular, this answer states "$|µ_1\log 2+µ_2\log 3|\geq H^{-13.3}$ with $H=max(|µ_1|,|µ_2|)$". This shows there's a specified lower bound on the difference of the logarithms. For more details about this, a Rhin bound site search currently has $17$ results. – John Omielan Apr 09 '25 at 14:04
  • 1
    @user1606702 related yes. And I got to this by considering related ideas towards Collatz. However this is less general and not equivalent I think. Unfortunately some related topics were closed (some not). – mick Apr 09 '25 at 22:07
  • I now think Collatz conjecture is true. To much to comment. Probably start a new thread in the future about that. Not claiming a proof but some heuristics ... – mick Apr 09 '25 at 22:15
  • 1
    Maybe we can apply Baker's theory in logarithmic forms for $3^a\cdot2^{-b} - 1$ and get something? – SARTHAK GUPTA Apr 24 '25 at 19:17
  • Choose $a$ arbitrarily, and then $b < a \log_2(3)$. – Dan Apr 24 '25 at 22:20
  • Why 217? are you certain that there are no smaller values of $3^a-2^b$ ? – Esteban Crespi Apr 25 '25 at 14:09

3 Answers3

8

Actually it has solutions, I found $$3^5-2^0=242,3^5-2^1=241,3^5-2^2=239,3^5-2^3=235,3^5-2^4=227,$$ $$3^6-2^0=728,3^6-2^1=727,3^6-2^2=725,3^6-2^3=721,3^6-2^4=713,$$ $$3^6-2^5=697,3^6-2^6=665,3^6-2^7=601,3^6-2^8=473,3^7-2^0=2186,$$ $$3^7-2^1=2185,3^7-2^2=2183,3^7-2^3=2179,3^7-2^4=2171,3^7-2^5=2155,$$ $$3^7-2^6=2123,3^7-2^7=2059,3^7-2^8=1931,3^7-2^9=1675,3^7-2^{10}=1163$$ Plus infinitely many that satisfy $ab<0$. But if you did not mean that, then the greedy algorithm is equivalent to the values of $$f(a)=3^a-2^{\lfloor a\log_2 3\rfloor}$$ As by the linked OEIS page. I run a quick check and found no $a\le 300$ that satisfy the inequality above.

import math
lower_bound = 217
upper_bound = 2465
found = False
for a in range(1, 301):
    power_3 = 3 ** a
    log_floor = math.floor(math.log2(power_3))
    power_2 = 2 ** log_floor
    difference = power_3 - power_2
    if lower_bound < difference < upper_bound:
        print(f"a = {a}, 3^a = {power_3}, 2^floor(log2(3^a)) = {power_2}, diff = {difference}")
        found = True
if not found:
    print("No value of a in the range 1 to 300 satisfies the inequality.")

As @Gottfried Helms' extended comment mentioned that: $$\frac{1}{453a^{13.3}}<\left|a\ln 3-\lfloor a\log_2 3\rfloor\ln 2\right|$$ I don't think this is useless, as we can use this to attack the problem: $$\exp\left(\frac{1}{453a^{13.3}}\right)<\frac{3^a}{2^{\lfloor a\log_2 3\rfloor}}$$ $$\implies 3^a-2^{\lfloor a\log_2 3\rfloor}>2^{\lfloor a\log_2 3\rfloor}\left(\exp\left(\frac{1}{453a^{13.3}}\right)-1\right)>2^{a\log_2 3-1}\left(453a^{13.3}\right)^{-1}$$ And $2^{a\log_2 3-1}\left(453a^{13.3}\right)^{-1}$ surpasses $2465$ for $a\gtrapprox 63.57$.

Since earlier brute force shows that every $a\le 300$ does not satisfy the inequality problem, we conclude that $3^a-2^{\lfloor a\log_2 3\rfloor}\not\in(217;2465)$

Unless I got something wrong, kindly tell me so I can rollback the edit :)

Thinh Dinh
  • 8,233
3

Another "extended comment". According to J. Simons in his article on "m-cycles in" the Collatz-problem 1 there is a lower bound for $\log(3^N/2^S)$ where $S=\lfloor N*\log_2(3) \rfloor$ by G. Rhin $$ \frac1{453 \cdot N^{13.3}} < |N \log 3 - S\log 2| \tag 1 $$ This is of course a very very weak lower bound, and should be quite useless for your problem.

But it may be interesting that I conjectured a much better lower bound as $$ \frac1{10 N \log N} < |N \log 3 - S\log 2| \tag 2$$ which I checked for the case when $S=\lceil N \cdot \log_2(3) \rceil$ instead and $2^S$ is the next larger power of $2$ over $3^N$ to be valid up to $N=10^{10^6}$ using the convergents of the continued fraction of $\log_2(3)$. The tightest seen approximation has been at $N \approx 10^{167.420644}$ and that case made me fix the constant to the value $10$. The curve of the trend pictured together with the empirical values makes a much much better impression of a realistic fit than the curve taken by the Rhin-lower bound. Another rather good approximating $N$ is at about $N \approx 10^{10853.9159281}$ - but in general the distance to the best approximated values grows slightly with the increasing $\log(N)$ - so there seems also room for improvement of the lower-bound function.

I have no proof for that lower bound holding for all $N$, but perhaps it gives some hint for your explorations (and finally might get improved by some cosmetic shaping).

In the picture below I draw the lower bounds given by G. Rhin (green colour) ,another one by Ellison (red), and that conjecture of mine (browne). See the much smoother adaption of the latter curve to the decreasing minimals of the empirical values(black points) :

Comparision of three lower bounds for Slog(2)-Nlog(3)


update

  • Explanation how to use my conjectured lower bound for your problem: From $$ \frac1{10 N \log N} < |N \log 3 - S\log 2| \tag 3 \\$$ we can step towards a formula better for estimate the lower bound for elements of your sequence depending on $N$: $$ \exp(\frac1{10 N \log N})< \frac{3^N}{2^S} \tag {3a}\\ \exp(\frac1{10 N \log N})-1< \frac{3^N}{2^S}-1 \\$$ $$ 2^S \cdot (\exp(\frac1{10 N \log N})-1)< 3^N - 2^S \tag {3b} $$ Removing small elements in the Taylorseries for $\exp(x)-1$ we can give an a bit weaker lower bound estimate: $$ \frac{ 2^S}{10 N \log N} < 3^N - 2^S \\ \tag 4 $$ It shows, that the lower bound increases roughly with $2^S/N/10$ and this lower bound exceeds your value $2465$ very soon (=with small $N$).

Update 2
Legend:

  • "lb[Helms]" - my conjectured lower bound for Lambda
  • "Lambda" - $N \cdot \log(3) - S \cdot \log(2)$
  • "lhs_1" - short form evaluation of the $\exp()-1$ expression in in (3b),see (4)
  • "lhs_2" - full evaluation of the $\exp()-1$ expression in (3b)
  • "rhs" - the $3^N - 2^S$ expression in the rhs of (3b),(4)

Data:

   N     S     lb[Helms]    Lambda        lhs_1      lhs_2     rhs
    2    3    0.0721348    0.117783    0.577078    0.598401     1.00000
    3    4    0.0303413    0.523248    0.485461    0.492901     11.0000
    4    6    0.0180337    0.235566     1.15416     1.16463     17.0000
    5    7    0.0124267    0.641031     1.59062     1.60054     115.000
    6    9   0.00930184    0.353349     4.76254     4.78476     217.000
    7   11   0.00734140   0.0656670     15.0352     15.0905     139.000
    8   12   0.00601123    0.471132     24.6220     24.6961     2465.00
    9   14   0.00505688    0.183450     82.8520     83.0618     3299.00
   10   15   0.00434294    0.588915     142.310     142.619     26281.0
   11   17   0.00379120    0.301233     496.921     497.864     46075.0
   12   19   0.00335358   0.0135510     1758.24     1761.19     7153.00
   13   20   0.00299901    0.419016     3144.69     3149.41   5.45747E5
   14   22   0.00270659    0.131334     11352.3     11367.7   5.88665E5

The rhs-value $2465$ in row of $N=8$ is overtaken by the $3144.69$ resp $3149.41$ values of resp. lhs in row of $N=13$ .
Because lhs is monotonuously increasing (from $N \ge 3$) and rhs is (by conjecture) always greater than lhs, there are no more numerical tests to be done.

1 Simons, John L., On the (non-)existence of (m)-cycles for generalized Syracuse sequences, Acta Arith. 131, No. 3, 217-254 (2008). ZBL1137.11016.,

1

Extended comment:

When I submitted OEIS A056577 back in 2000, it was part of a hand-wavey argument that there probably were not more small gaps in absolute terms, even though the gaps were not monotonically increasing.

The argument was roughly:

  • If $g(n) = 3^n - 2^{\lfloor \log_2(3^n)\rfloor}$ is the $n$th gap, then it is in the interval $(0,3^n/2)$.

  • So $h(n) = g(n)/3^n$ is in the interval $\left(0,\frac12\right)$. We can give a form for generating $h(n)$ starting at $h_1=\frac13$:
    $$h(n+1) = \left\{ \begin{array}{cl} \dfrac{2h(n)+1}{3} & \text{if }h(n)\lt \frac14 \\ \dfrac{4h(n)-1}{3} & \text{if }h(n)\ge \frac14 . \end{array}\right.$$

  • So when $\frac14 \le h(n) \lt \frac13$ (about $17\%$ of the time) we have $h(n+1) < \frac{h(n)}{3}$ and so $g(n+1)<g(n)$.

  • We should not expect $h(n)$ to be uniformly distributed in $\left(0,\frac12\right)$ as it can only take rational values with a denominator of $3^n$ and an odd numerator, and it is slightly more likely to take larger values than smaller ones, but it is plausible in a sense that the distribution of the $h(n)$ might be close to having a density of $\frac{1}{(1-x)\log_e(2)}$ in $\left(0,\frac12\right)$ and empirical investigation seems to justify this.

  • So it seems likely that, once $\frac{3^n}{2}$ is bigger than the upper limit of your interval $(a,b)$, the chance that $h(n)<\frac{b}{3^n}$ (i.e. the gap $g(n) < b$) is probably less than $\frac{2b}{3^n}$ and that there may be any $m\ge n$ with $g(n)<b$ is probably less than $\frac{b}{3^n}$.

  • If you know there are no examples of gaps between $217$ and $2465$ up to $n=10^5$ then this might suggest the chance of any more such gaps for larger $n$ may be less than $\frac{2465}{3^{10^5}} \approx 10^{-47708}$. Not impossible and so not a proof, but highly improbable.

Henry
  • 169,616
  • Thank you. And thanks for submitting that sequence. I am a bit lost how you got that recurrence though. I never seen it before, maybe Im not reading the right stuff ? – mick Apr 09 '25 at 22:22
  • 1
    @mick Depending on whether you can fit two more powers of $2$ in (or only one) as you go to the next power of $3$, you can say $g(n+1) = 3^{n+1}-2^{2+n\lfloor \log_2(3)\rfloor} = 4g(n) - 3^n$ if that is non-negative, i.e. when $g(n) \ge \frac{3^n}4$, and $g(n+1) = 3^{n+1}-2^{1+n\lfloor \log_2(3)\rfloor} = 2g(n) + 3^n$ if not. Then divide through by $3^{n+1}$ to get $h(n+1)$ in terms of $h(n)$. – Henry Apr 09 '25 at 22:49