<s>[INST] Finding all positive integers $x,y,z$ that satisfy $2^x=3^y7^z+1$ 
Find all positive integers $x,y,z$ that satisfy  $$2^x=3^y7^z+1$$.

I think that $(x,y,z)=(6,2,1)$ is the only solution, But how can I prove this?
 [/INST] Looking at the equation mod $7$ we see that $2^x = 1 \pmod 7$ which means $3 \mid x$ by Lagrange's theorem. Looking at the equation mod $3$ we see that $(-1)^x = 1 \pmod 3$ so $x$ is even.
Hence there is a positive integer $k$ such that $x = 6k$.
Rewrite the equation as $2^{6k} = 3^y7^z + 1$, which can also be written as $(2^k-1)(2^k+1)(2^{2k}+2^k+1)(2^{2k}-2^k+1)= 3^y7^z$
obtained by factoring the polynomial $X^6 - 1$.
If $k \gt 0$ then:
$\gcd(2^k - 1, 2^k + 1) = \gcd(2^k + 1, 2) = 1$,
$\gcd(2^k-1, 2^{2k}-2^k+1) = \gcd(2^k - 1, 2^{2k}) = 1$, and
$\gcd(2^k+1, 2^{2k}-2^k+1) = \gcd(2^k+1, 2^{k+1}-1) = \gcd(2^k + 1, 3) = 1$ or $3$.
Note that if all $3$ pairs were coprime then one of $2^k-1$, $2^k+1$ or $2^{2k}-2^k+1$ would need to be equal to $1$ since $3^y7^z$ has only two distinct prime factors. But for $k \gt 0$ the last two are always greater than $1$ so we have $2^k-1 = 1$ or $k = 1$.
This gives $x = 6$ and $3^y7^z = 3\cdot7\cdot3 = 3^27^1$ so we get $(x, y, z) = (6, 2, 1)$.
Otherwise we have $\gcd(2^k + 1, 2^{2k} - 2^k + 1) = \gcd(2^k + 1, 3) = 3$, in which case we can divide by $3^2$ to obtain $(2^k-1)\frac{2^k+1}{3}(2^{2k}+2^k+1)\frac{2^{2k}-2^k+1}{3} = 3^{y-2}7^z$ where now $2^k-1$, $\frac{2^k+1}{3}$ and $\frac{2^{2k}-2^k+1}{3}$ are pairwise coprime.
Proceeding as above, this means one of them must be one. We already saw the case $k = 1$ previously, and there are no other ways to make these equal to $1$.
</s>