# Does every odd integer $m$ satisfy $3^x(m)-2^y=1$ for some integer values of $x$ and $y$?

Does the equation $$3^x(m)-2^y=1$$ have positive integer solutions $$x, y$$ for for every positive odd number $$m$$?

For example, for $$m = 1$$, we have $$x = 1, y = 1$$: $$3^1(1)-2^1=1$$. For $$m=3$$, the (only) solution is $$x=1,y=3$$. But what about the general case?

This question looks like Mihăilescu's theorem, which proves that the only solution to $$3^x-2^y=1$$ is $$x=2$$ and $$y=3$$, but of course we have the extra multiplicand m in there, and what I want to prove is in fact that there are (or aren't) solutions for all positive odd numbers m.

I've been looking into an unrelated problem and it would be helpful to prove or disprove this but I really don't know where to start. My inclination is to say that there must be solutions $$x,y$$ for all $$m$$, because with an infinite number of powers of two and an infinite number of powers of three to work with there will always be a pair somewhere that will have the necessary relation to one another. But I'm lost as to how to translate that into proof, if indeed the statement is even true.

Any help - even partial help - would be greatly appreciated.

Edit: Thanks Travis, thanks Conrad, that solves it for me. I think I can't accept either of you as the "solution" here (I'm new!) but tell me if that's untrue. And thanks!

• For $m=5$, there is no solution with $x>0$ and for $m=15$ there is no solution - note that $2^n+1$ divides by $5$ only when $n=4k+2$, $2^n+1$ divides by $3$ only when $n$ odd – Conrad Aug 27 at 17:27
• Reducing modulo $m$ gives $2^y \equiv -1 \pmod m$, but if $2$ has odd order in $(\Bbb Z / m \Bbb Z)^\times$, which occurs for $m = 7, 15, 21, \ldots$, then that congruence admits no solution. oeis.org/A014659 – Travis Willse Aug 27 at 17:51
• Re your comment in the edit to your post (which should be here in the comments and not in the question), that's right, you can only accept one answer, but you can up- or (down-)vote as many answers as you like. In any case, don't worry too much about the politics of which answer you accept. – Travis Willse Aug 27 at 20:07
• (And welcome, by the way. This is a good first question.) – Travis Willse Aug 27 at 20:08
• Skimbo: In fact, we can describe exactly which $m$ admit solutions---see math.stackexchange.com/questions/3336525/… . – Travis Willse Aug 28 at 0:52

No, this is not true in general.

For $$m$$ a power $$3^n$$ of $$3$$, we can rewrite the equation as $$3^{x + n} - 2^y = 1,$$ but then it follows from Mihăilescu's Theorem that solutions are only possible for $$n \leq 2$$, giving for $$m = 1, 3$$, respectively the solutions $$(2, 3)$$ and $$(1, 3)$$.

This is not the only obstacle: Reducing the equation modulo $$m$$ and rearranging leaves $$2^y \equiv -1 \pmod m ,$$ but this congruence only admits a solution if $$2$$ has even order in the group $$(\Bbb Z / m \Bbb Z)^\times$$ of units modulo $$m$$. This means there are no solutions for $$m = 7, 15, 21, 23, 31, \ldots$$, that is, for the elements of OEIS A014659.

There are yet other examples: For example, for $$m = 13$$, $$2$$ has order $$12$$ and so the above congruence implies $$y = 12 z + 6$$, and the equation becomes $$13 \cdot 3^x - 2^6 \cdot (2^{12})^z = 1 .$$ Reducing modulo $$4$$ gives $$(-1)^x \equiv 1 \pmod 4$$, so $$x = 2 a$$, and the equation becomes $$13 \cdot 9^a - 2^6 \cdot (2^{12})^z = 1 .$$ Finally, reducing modulo $$5$$ and rearranging leaves $$3 \cdot (-1)^a \equiv 0 \pmod 5$$, but this has no solutions.

On the other hand, we observe that for $$m = 11$$, $$x = 1, y = 5$$ is a solution. Together with Conrad's observation in the comments, this shows that the only odd values $$m$$, $$1 \leq m \leq 15$$, that admit solutions are $$m = 1, 3, 11$$.

A quick computer search finds that the only other $$m < 1\,000$$ with solutions $$(x, y)$$ with $$x < 1\,000$$ are $$19, 43, 57, 171, 683$$.

Edit In fact, the answer to a question motivated by this one shows that the $$m$$ that admit solutions are precisely those of the form $$m = \frac{2^{3^{y - 1} (2 k + 1)} + 1}{3^y} ,$$ and their corresponding solutions are $$(3^{y - 1} (2 k + 1), y) .$$

No, take $$m$$ to be a power of $$3$$, your question reduces to: Distance between powers of 2 and 3

Hope it helps:)