# Exponential diophantine equation $2^x+7^y=9^z$.

The challenge is to solve this equation $$2^{x}+7^{y}=9^{z}$$ in positive integers. The obvious solution is $$x=y=z=1$$. Using brute force, I found $$3$$ possible solutions: $$\begin{eqnarray*} (x_1,y_1,z_1)&=&(3,0,1),\\ (x_2,y_2,z_2)&=&(1,1,1)\\ (x_3,y_3,z_3)&=&(5,2,2).\\ \end{eqnarray*}$$ There are no other natural solutions for $$z≤10000$$.

It seems that the equation $$2^{x}+7^{y}=9^{z}$$ has no other solutions in natural numbers. How can this be proven?

• Technically one of your solutions doesn't take $y$ to be a positive integer.
– J.G.
Nov 3, 2021 at 19:36
• @J.G. Good point, but that doesn't change much. Nov 3, 2021 at 19:39
• True.
– J.G.
Nov 3, 2021 at 19:42

Hint 1: If $$x>1$$ then reducing mod $$4$$ shows that $$y$$ is even, say $$y=2v$$, and so $$2^x=(3^z+7^v)(3^z-7^v).$$ Hint 2: It follows that $$3^z-2^{x-2}=1$$.

• Modulo $80$, we get $x=4k+5$, $y=4l+2$, $z=2m$. It is important that $y$ is even. It doesn't matter what $z$ is, since $9$ is already a square. I also considered your idea, but did not go far. Nov 3, 2021 at 21:11
• @Cornifer I have added another hint. Nov 3, 2021 at 22:31
• @Mike Sorry about misunderstanding your earlier comment. Also, thanks for the compliment. Although I sometimes can determine how to solve a challenging problem quite quickly (although it usually takes some time, and occasionally an inordinate amount of time!), I don't see anything particularly simple & obvious here. Nonetheless, my initial approach would be something like what is done in the AOPS link in Max Alekseyev's answer. Perhaps later, if this is not fully solved then & I have some time, I'll try to finish it myself. Nov 4, 2021 at 6:00
• @Mike To clarify my last sentence, note Max Alekseyev's answer does fully solve this. I meant determining a simpler solution than using modulo $17043520$, in particular one which can be fully explained & understood within a reasonable size answer. Nov 4, 2021 at 7:22
• @JohnOmielan Thanks for the tip! I'd say it's obvious that there's no solution with $x=2$, but this covers it explicitly and looks cleaner. Nov 4, 2021 at 7:59

It is easy to verify computationally that considering the equation modulo $$17043520$$ implies that it has the only solutions: $$(x,y,z)\in \{ (1, 1, 1),\ (3, 0, 1),\ (5, 2, 2)\}.$$

I refer to the discussion at AOPS on how to find such a modulus. The one I mentioned above may be not the smallest possible, but it does the job.

UPDATE. As established by brute-force, the smallest working modulus here is $$128320$$.

PS. For the theory behind such equations, see the paper:

J. L. Brenner, L. L. Foster "Exponential Diophantine equations". Pacific J. Math. Volume 101, Number 2 (1982), 263-301. http://projecteuclid.org/euclid.pjm/1102724775

here is a method I learned from Exponential Diophantine equation $7^y + 2 = 3^x$ and polished. I have answered many questions of the form $$A^u - B^v = C$$ for given positive integers $$A,B,C$$

This answer finishes $$x=1.$$

The following shows that, with $$x = 1,$$ the largest solution to $$9^z - 7^y = 2$$ is $$z=y=1.$$ First, write $$9^z - 9 = 7^y -7$$ Next introduce non-negative integers $$p,q$$ with $$9(9^p - 1) = 7 (7^q - 1),$$ ASSUME $$p,q \geq 1$$ and reach a contradiction. We alternate steps, each is a calculation.

$$7 | 9^p -1 \Longrightarrow \; \; 3 | p$$ $$9^3 - 1 = 2^3 \cdot 7 \cdot 13$$ $$13 | 7^q -1 \Longrightarrow \; \; 12 | q$$ $$7^{12} - 1 = 2^5 \cdot 3^2 \cdot 5^2 \cdot 13 \cdot 19 \cdot 43 \cdot 181$$

$$19 | 9^p -1 \Longrightarrow \; \; 9 | p$$ $$9^9 - 1 = 2^3 \cdot 7 \cdot 13 \cdot 19 \cdot 37 \cdot 757$$ $$37 | 7^q -1 \Longrightarrow \; \; 9 | q$$ $$7^{9} - 1 = 2 \cdot 3^3 \cdot 19 \cdot 37 \cdot 1063$$

This number divides $$9 (9^p - 1).$$ In particular, $$27 | 9 (9^p - 1).$$ This CONTRADICTS the assumption that $$p > 0$$

Refer to Henri Cohen's Number Theory Volume I: Tools for Diophantine Equations p. $$410-411$$ and also $$461$$ for exercise $$35$$.

For $$x = 1$$, the equation becomes $$2+7^{y}=9^{z} \implies 2+7^{y}=(3^z)^2 \implies (3^{z})^{2}=7^{y}+2.$$

On page $$410$$ we have $$6.7$$ The Equation:

$$y^{2} = x^{n}+t$$ for $$-100 \leq t \leq -1$$ and $$n$$ even, $$t \not\equiv 1 \pmod {8}$$, and $$t$$ squarefree.

By page $$419$$, the above result is generalized to include odd $$n$$ as well, showing that each equation satisfying the above has a finite number of solutions, listed in a table in the book.

It is indicated that using the reasoning of the proofs of recent theorems, this result can be extended to $$|t| \leq 100.$$

It seems a lot of directly related material is in Chapter $$6.7$$ of this book and the in-text references, as well as the prerequisite material contained within, however it is clear much of it is "left to the reader" to organize as a proof for exercise $$35$$ which I am personally unable to do myself at this time.

• Not sure why I get a downvote, it is a direct reference to a generalization to the equation. One answer just writes it is easy to verify, and the other two don't consider $x=1$, but I get the downvote only. Ok. Nov 4, 2021 at 13:01
• I upvoted this, because I didn't think it deserved a downvote either. The reference does look interesting. But for questions like these, what is the more satisfying--and expected--for most of us, are reasonably self-contained answers as opposed to referencing another source.
– Mike
Nov 4, 2021 at 13:21
• there is also a way tyo do $x=1$ with simple calculations, I put an answer. Nov 5, 2021 at 18:43

This is a PARTIAL answer. What remains to show is that there are not an infinite number of solutions for $$x=1$$. Assume $$x\ge 3$$. Then as in Conner's answer, $$2^x = (3^z-7^v)(3^z+7^v).$$

This gives for some positive integer $$a$$ the equation $$2^a(3^z-7^v)=(3^z+7^v).$$

Rearranging terms gives $$(2^a-1)3^z = (2^a+1)7^v,$$

Note that this implies that $$a$$ must also be at least 3. So this gives $$2^a+1=3^z$$. As $$a$$ is at least $$3$$ [because one can check that there are no solutions to the above equation for $$a \in \{1,2\}$$], it follows that $$2^a+1=3^z$$ and thus in particular $$3^z$$ must be $$1$$ mod $$8$$, and so it follows that $$z$$ must be even, which gives

$$(3^{z/2}-1)(3^{z/2}+1) = 2^a,$$ which implies both $$3^{z/2}-1$$, $$3^{z/2}+1$$, must be powers of $$2$$. As they differ by only $$2$$, this is possible only if $$z=2$$ and $$a=3$$. So if $$x$$ is at least $$3$$, then $$v$$ must be $$1$$ and thus $$y$$ must be $$2$$. Thus $$x$$ must be $$5$$ and $$z=2$$.

• FYI, here's an alternate way to solve for $x \ge 2$ the equation $2^x = (3^z - 7^v)(3^z + 7^v)$. First, note both factors on the right are positive, even and powers of $2$. Thus, $3^z - 7^v = 2^a$ and $3^z + 7^v = 2^b$ with $a \lt b$ and $a + b = x$. Adding the $2$ equations gives $2(3^z) = 2^a + 2^b = 2^a(1 + 2^{b - a})$. Equating the even and odd parts gives $2 = 2^a \; \to \; a = 1$ and $3^z = 1 + 2^{b - a} \implies 3^z - 2^{b - a} = 1$. If $b - a = 1 \; \to \; b = 2$, then $x = 3$ and $z = 1$. ... Nov 4, 2021 at 6:13
• (cont.) Otherwise, with $b - a \gt 1$ and $z \gt 1$, there are proofs here, plus Mihăilescu's theorem can be used, to show the only solution is $z = 2$ and $b - a = 3 \; \to \; b = 4$, so $x = 5$. Nov 4, 2021 at 6:14