Finding all positive integers $x,y,z$ that satisfy $3^x - 5^y = z^2$

2.9k Views Asked by At

Find all positive integers $x,y,z$ that satisfy:

$$3^x - 5^y = z^2.$$

I think that $(x,y,z)= (2,1,2)$ will be the only solution. But how to prove that?

2

There are 2 best solutions below

8
On

Notice that:

$$\begin{align}3^x - 5^y &\equiv (-1)^{x} - 1 \mod 4\\ z^2 &\equiv (-1)^x - 1 \mod{4}\\ &\equiv \begin{cases} 0 & \text{$x$ even,}\\ 2 & \text{$x$ odd}\end{cases} \end{align}$$

Since $2$ is a quadratic non-residue modulo $4$, $x$ must be even $\implies x = 2a$ for positive integer $a$. Furthermore, $4| z^2 \implies 2|z \implies z = 2b$ for positive integer b.

Hence, we get: $$\begin{align}3^{2a} - 5^y &= (2b)^2\\ 5^y &= 3^{2a} - (2b)^2\\ 5^y &= (3^a + 2b)(3^a - 2b)\end{align}$$

If $(3^a - 2b) > 1$, we notice that : $$\begin{align} &a,b > 0, a \in \mathbb{Z}\\ \implies &3^a + 2b > 3^a - 2b \ge 1\\ \implies &3^a + 2b > 1\end{align}$$

But $3^a + 2b$ is a perfect power of 5, implying that $5|(3^a + 2b)$. Hence, we have :

$$\begin{align} 3^a + 2b &\equiv 0 \mod 5\\ 3^a - 2b &\equiv -4b \mod 5\\ 3^a - 2b &\equiv b \mod 5\end{align}$$

If $(3^a - 2b)$ is a perfect power of $5$ (excluding 1), then from above, we get $b = 5k$ for positive integer $k$. But if $b = 5k$, then: $$\begin{align}3^a + 2b &= 3^a + 10k\\ &\equiv 3^a \mod {5}\\ &\not\equiv 0 \mod{5}\end{align}$$

Hence, $(3^a - 2b)$ cannot be greater than $1$ $\implies 3^{\frac{x}{2}} - z = 1 \implies 3^x = (1 + z)^2$, which has infinitely many solutions, one of which is $x = 2, z = 2 \implies y = 1$. Now, we just have to find a way to show that there are no other solutions.

0
On

I will give a brief review to Yiyuan's answer, and then complete the proof. We have: $$3^x-5^y=z^2$$ Working $\pmod4$, we have $(-1)^x-1\equiv 0,1 \pmod4$, so $x$ has to be even. Substituting $x=2k$ and $y=a+b$: $$(3^k-z)(3^k+z)=5^y\implies 3^k-z=5^a, 3^k+z=5^b\implies 2\times3^k=5^a+5^b$$

If $a,b\ge1$, then the RHS is a multiple of $5$ but the LHS is not, so WLOG assume $b=0$. Then: $$2\times3^k=1+5^a$$ There is no solutions with $k=0$ and one with $k=1(x=2,y=1,z=2)$. Assume henceforth that $k\ge 2$. We then have $-1\equiv 5^a \pmod9$, and since $a=3$ is the smallest solution, we can easily see that every solution is of the form $a=6m+3=3(2m+1)$. Finally $$2\times3^k=1+5^{3(2m+1)}=(1+5^3)(\cdots)=126(\cdots)$$ But now the RHS is a multiple of $7$. Therefore the only solution is $(x=2,y=1,z=2)$.