# Find all positive integers $n$ and $m$ such that $(125\times2^n)-3^m=271$

Find all positive integers $$n$$ and $$m$$ such that $$(125\times2^n)-3^m=271$$

I have thought about this question for a long time and I can't seem to solve it. I realize that $$271$$ is a prime and so I'm tried to factor the LHS but couldn't. I came to the conclusion that n is odd and m is equivalent to $$2$$ modulo $$4$$ by using modulo $$3$$ and $$5$$ respectively. Any help would be appreciated.

• Note; $(n,m)=(3,6)$ is one solution Commented May 17, 2019 at 20:59
• @J.W.Tanner I did realize that and I was able to solve for m and n when they were multiples of 3, but couldn't continue for other values. Commented May 17, 2019 at 21:09
• Note that with $p=n-3$ and $q=m-6$ (small solutions can be dealt with easily) we have $1000\cdot 2^p-729\cdot 3^q=1000-729$ so that $1000\cdot (2^p-1)=729(3^q-1)$ - there are prospects here, and modulo $1000$ and $729$ you get a sparser set of possibilities than modulo $3$ and $5$. Commented May 17, 2019 at 22:11
• @MarkBennet $q \equiv 0 \pmod {100},$ in particular $q \equiv 0 \pmod 4,$ then $3^q-1$ is divisible by $16,$ therefore $2^p - 1$ is even and $p=0$ Commented May 17, 2019 at 22:38
• @WillJagy you should write this out as an answer. This looks really nice
– Mike
Commented May 17, 2019 at 22:41

I put a really difficult example of this method at Finding solutions to the diophantine equation $7^a=3^b+100$ including some links to easier examples and the place where I learned it; seems fair to give credit to the student who seems to have invented it, Exponential Diophantine equation $7^y + 2 = 3^x$

From Mark Bennet, we reach $$1000 (2^p - 1) = 729 (3^q - 1)$$ The argument goes back and forth, this one is quick: we know $$3^q \equiv 1 \pmod 5 \; ,$$ so that $$q \equiv 0 \pmod 4 \; .$$ However, then $$3^4 - 1 = 81 - 1 = 80 = 16 \cdot 5,$$ so $$3^q - 1 \equiv 0 \pmod {16}.$$ Now $$16 | 1000 (2^p-1) \; ,$$ so $$2^p - 1$$ is even and $$p=0$$

• Nicely done. I was falling asleep at the screen and didn't follow i through ... Commented May 18, 2019 at 7:46
• So a little more generally than the case in the link, if $ap^M-bq^N=r$ has the solution $ap^m-bq^n=r$ we can eliminate $r$ to obtain $ap^m(p^{M-m}-1)=bq^n(q^{N-n}-1)$ and this method can be used to investigate 'large' solutions. I am now wondering what might be known which would throw further light on this procedure and when it will work and if it ever fails. Commented May 18, 2019 at 8:10
• @MarkBennet thanks. Gottfried came up with a different view of this. I'm not sure it ever fails, but I attempted one where the numbers got too big to continue with my computer/software. The way I do it is pretty random looking, go through all prime factors of some $p^d - 1,$ whee $d$ is large enough to make $p^d-1$ enormous. I have no idea how to predict the prime factor that should be picked for the next step... Commented May 18, 2019 at 17:59