Finding positive integer solutions to $a!+5^b=7^c$

elementary-number-theorynumber theory

This question: "Solve: $a!+5^b=7^c$" was closed for lack of context, and probably lack of effort by OP. Nonetheless, the question is interesting in itself, and several particular solutions were given in the comments. I show here those given answers are nearly exhaustive, and pose a question about the one instance for which I have not yet obtained a which a full solution.

  1. Based on parity alone, $a!$ must be even, hence $a \ge 2$

  2. $\min (a!+5^b)=2!+5^0=3$, hence $c \ne 0$

  3. If $a\ge 7$, then $7\mid a! \land 7\mid 7^c \Rightarrow 7\mid 5^b$. This is not possible, so $a<7$

  4. Examine the case $b=0$. Here, $2\le a \le 6 \Rightarrow a! \in \{2,6,24,120,720\}$ and $a!+5^0=a!+1 \in \{3,7,25,121,721\}$. The only instance in which $a!+5^0=7^c$ is $3!+5^0=7$. Solution 1 is $a=3,b=0,c=1$

  5. If $b>0 \land a\ge 5$, then $5\mid a! \land 5\mid 5^b \Rightarrow 5\mid 7^c$. This is not possible, so $a<5$

  6. $2\le a \le 4 \Rightarrow a! \in \{2,6,24\}$. We can examine each of these three cases individually.

  7. $24+5^b=7^c$ is analyzed modulo $7$ and modulo $5$. First, $3+5^b\equiv 0 \bmod 7$ is true when $b$ has the form $6m+2$. Next, $4\equiv 7^c \equiv 2^c \bmod 5$ is true when $c$ has the form $4n+2$. In order to have integer solutions, this equation must be formulated $24+5^{6m+2}=7^{4n+2}$. Rearranging, $24=7^{2(2n+1)}-5^{2(3m+1)}$. This is simply the difference of two squares, viz: $24=(7^{(2n+1)}-5^{(3m+1)})(7^{(2n+1)}+5^{(3m+1)})$. This resolves $24$ into two factors, both of which are even and have no common factors other than $2$. The possiblities for this are $24=2\times 12$ and $24=4\times 6$. Moreover, for $m>1$ or $n>1$, the factor $(7^{(2n+1)}+5^{(3m+1)})$ is much larger than $24$ itself, so the only possible candidate is given by $m=n=0$, which sets $24=(7-5)(7+5)=2\cdot 12$ which is true, leading uniquely to Solution 2: $a=4,b=2,c=2$

  8. $6+5^b=7^c$ is analyzed modulo $7$ and modulo $5$. First, $6+5^b\equiv 0 \bmod 7$ is true when $b$ has the form $6m$. Next, $1\equiv 7^c \equiv 2^c \bmod 5$ is true when $c$ has the form $4n$. As before, we derive $6=(7^{(2n)}-5^{(3m)})(7^{(2n)}+5^{(3m)})$. This plainly has no solutions because each of the factors is even and contains at least one factor of $2$, but $6$ has only one factor of $2$. So there are no solutions in this instance.

  9. $2+5^b=7^c$ is analyzed modulo $7$ and modulo $5$. First, $2+5^b\equiv 0 \bmod 7$ is true when $b$ has the form $6m+1$. Next, $2\equiv 7^c \equiv 2^c \bmod 5$ is true when $c$ has the form $4n+1$. In order to have integer solutions, this equation must be formulated $2+5^{6m+1}=7^{4n+1}$. By inspection, when $m=n=0$, we get Solution 3: $a=2,b=1,c=1$. Here I am stopped. Since a solution exists, it is not likely that I can rule out larger solutions (i.e. for $mn \ge 1$) by modular arithmetic, and since the exponents in this case are odd, I cannot use the difference of two squares trick which afforded solutions in the previous cases.

My question is: Is there a method or strategy for evaluating the existence and nature of solutions to $2+5^{6m+1}=7^{4n+1}$ for $mn \ge 1$?

Best Answer

If $mn\geqslant 1$, then one has $$5^{6m+1}\equiv 25\pmod{100}\qquad \text{and}\qquad 7^{4n+1}\equiv 7\pmod{100}$$ So, if $mn\geqslant 1$, then $2+5^{6m+1}=7^{4n+1}$ has no solutions.