<s>[INST] How many integer solutions of $2^x+3^y-7n=0,~n \in \mathbb Z$? Consider the equation $2^x+3^y=7n,~n \in \mathbb Z$.

How many integer (positive) solutions are there for this equation? Can it have infinitely many positive integer solutions?
What is an example of a positive rational solution?


To reduce the number of variables, we fix $x$ as follows:
Fix $x=3$, then the equation becomes $$2^3+3^y=7n \Rightarrow 3^y=7n-8 \Rightarrow 3^y=27\Rightarrow y=3,$$ taking $n=5$. So $(3,3)$ is an integer solution.  Is there other integer solutions for other $n$ ?
So when $x=3$, we can draw $3^y=7z-8$ and see the graph is asymptotic in nature. I doubt there is other positive integer solution.
If we fix $x=5$, then the equation becomes $$2^5+3^y=7n \Rightarrow 3^y=7n-32 \Rightarrow 3^y=3\Rightarrow y=3,$$ taking $n=1$. So $(5,1)$ is an integer solution. Again, if we draw the curve $3^y=7z-32$ and see it is asymptotic in nature. I doubt there is other positive integer solution except $(5,1)$.
My intuition says, if we fix $x$ to be positive integer, then $y$ can take only one positive integer. There might be positive rational solution, but I don't know off them.
Therefore the equation $2^x+3^y=7n,~n \in \mathbb Z$ and $x,y \in \mathbb N$ has "countably" many solutions, for each $x \in \mathbb N$ there is only one $y \in \mathbb N$.
Are there any examples of positive rational solutions that are not integer solutions?
I appreciate your answer.
 [/INST] Rewriting the equation in modulo 7, we have
$$3^y\equiv -2^x \quad  \pmod 7 $$
Noting that $2^3\equiv 1 \quad  \pmod 7$, we get $3$ cases for $x$,
$\quad $ A.  $x=3h$,$ \quad $  B. $x=3k+1 \quad  $  and $\quad $ C. $3k+2$.
A. When $x=3h, $
$$
3^y \equiv-(2^{3}) ^h\equiv-1  \equiv 6 \quad  \pmod 7
$$
By the Fermat Little Theorem, $3^6\equiv 1 \quad  \pmod 7 $, we have
$$3^{6 m+3} \equiv  \left(3^6\right)^m \cdot 3^3 \equiv  1^m \cdot 3^3
\equiv 6 \quad  \pmod 7 
$$
Therefore $y=6m+3$.

B. When $x=3k+1, $
$$
3^y \equiv-2(2^{3}) ^k  \equiv-2  \equiv 5 \quad  \pmod 7
$$
By the Fermat Little Theorem, $3^6\equiv 1 \quad  \pmod 7 $, we have
$$3^{6 m+5} \equiv  \left(3^6\right)^m \cdot 3^5 \equiv  1^m \cdot 3^5
\equiv 5 \quad  \pmod 7 
$$
Therefore $y=6m+5$.

C. When $x=3k+2, $
$$
3^y \equiv-4(2^{3}) ^k  \equiv-4  \equiv 3 \quad  \pmod 7
$$
By the Fermat Little Theorem, $3^6\equiv 1 \quad  \pmod 7 $, we have
$$3^{6 m+1} \equiv  \left(3^6\right)^m \cdot 3\equiv  1^m \cdot 3
\equiv 3 \quad  \pmod 7 
$$
Therefore $y=6m+1$.

We now can conclude that there are infinitely many integer solutions $(x,y,n)$ which are
$$
\boxed{\left(3 h, 6 m+3 , \frac{2^{3 h}+3^{6 m+3}}{7}\right), 
\left(3 k+1,6 m+5, \frac{ 2^{3 k+1}+3^{6 m+5}}{7} \right) \quad  \textrm{ and } 
\left(3 k+2, 6m+1, \frac{2^{3k+2}+3^{6k+1}}{7}\right) }
$$
where $h\in N$ and $k,m \in N \cup\{0\}.$
</s>