# Finding all natural $x$, $y$, $z$ satisfying $7^x+1=3^y+5^z$

The problem goes as follows:

Find all possible pairs of $$x,y,z \in \mathbb{N}$$ which satisfy the equation $$7^x+1=3^y+5^z$$

My first instinct was to continue by modding, but I don't think I can get anything out of it. The obvious solutions seem to be $$x,y,z=1$$ and $$x,y,z=0$$, but I am not really sure how to approach the problem.

• Computer experiment shows that those are the only solutions with $0\leq x,y,z < 100$ Jan 30, 2021 at 19:56
• @PeterAllen where did you get the problem? I know of at least one similar problem in a published book, where it turned out the authors did not know how to solve it. Of course, they thought they could do it when they first published Jan 30, 2021 at 21:47
• By some considerations modulo 6,8,36 one gets $x,y,z$ odd (for values greater than 2) and $z-x \equiv 2 \pmod{6}$. Also, there are bounds $z \le \log_5(7) x, y \le \log_3(7) x, x \le \log_7(5) (x+y)$. Don't know if it can help. I hoped in an approach with increasing powers of 6 but from $6^3$ on there is a quadratic dependence on $x,z$ which is really unpleasant. Jan 31, 2021 at 0:20
• @Andrea Marino I was thinking something similar: that the bounds $y+z \le 4x$ would have to be used. It seems to be that the weaker condition $5^z +3^y -1 \mod 7^x =0$ has solutions in $y$ and $z$ no matter how large $x$ is.
– Mike
Jan 31, 2021 at 1:16
• Since 3 is a generator modulo 7 and 49, it is a generator modulo all powers of seven. The same holds for 5. Thus the weaker condition is satisfied and likely to be satisfied also for not-so-big $y$ and $z$, but I don't see how this prevents other modular obstructions to arise :'( P.S. To calculate the orders I used the website numbertheory.org/php/order.html Jan 31, 2021 at 1:51

The two solutions you found are indeed all of them. In fact, we can solve this with a straight mod bash, which was surprising to me.

If any of $$x,y,z$$ are $$0$$, then we easily get $$x=y=z=0$$. If $$y=1$$, then $$7^x=5^z+2$$, and we readily get that $$z=1$$, so $$x=1$$ too. So now assume $$y>1$$ and $$x,z>0$$. Let the mod bash begin.

Taking mod $$3$$ implies that $$z$$ is odd. Taking mod $$4$$ implies that $$x$$ and $$y$$ have the same parity. Taking mod $$5$$ then implies that $$x\equiv y\equiv 1\pmod 4$$.

Now taking mod $$7$$, we get that either (a) $$y\equiv1\pmod{12}$$ and $$z\equiv1\pmod{6}$$ or (b) $$y\equiv5\pmod{12}$$ and $$z\equiv5\pmod6$$.

Now taking mod $$9$$, in case (a) we have $$x\equiv5\pmod{12}$$ and in case (b) we have $$x\equiv9\pmod{12}$$.

Consider case (a). If $$z\equiv1\pmod{12}$$, then taking mod $$13$$ gives $$11+1\equiv3+5\pmod{13}$$; if $$z\equiv7\pmod{12}$$ we still get a contradiction $$11+1\equiv8+5\pmod{13}$$.

Similarly in case (b), we get a contradiction in mod $$13$$, considering both cases $$z\equiv 5\pmod{12}$$ and $$z\equiv11\pmod{12}$$.

• @S.Dolan but $x\equiv1\pmod 4$ which rules both of those out. Jan 31, 2021 at 16:58
• Excellent. Well done!
– user502266
Jan 31, 2021 at 17:06