# All positive integers satisfying $n2^n=5^m+7$

How can one solve each of the equations below in positive integers?

$$2^n=5mn+7$$ $$mn2^n=5^m+7$$ $$n2^n=5^m+7$$

-
Solutions $(m,n)$: (i) $(1,5)$; (iii) $(0,2)$ –  TMM Jun 4 '12 at 19:28
Looking for all solutions –  Julia_17 Jun 4 '12 at 20:18
Where does this problem come from? Where is it going? Is there any reason you expect to find a general theory for solving them? –  Steven Stadnicki Jun 4 '12 at 20:23
I am probing, I want to learn the different methods used to solve these equations. –  Julia_17 Jun 4 '12 at 20:33
This seems to be inspired by Ramanujan's square equation $2^n-7=x^2$. –  Tito Piezas III Jun 26 '12 at 19:43

Not a number theorist by trade, just an enthusiast, but there are some simple methods to reduce the solution space.

Odd and even are always helpful. For instance, in the first one, LHS is always even. For RHS to be even, must have m and n both odd.

Fives are good as well. Solve for $m$ and we get

$$m = (2^n-7)/(5n)$$

so for valid sol'ns, $2^n-7$ is divisible by $5$, i.e. ends in $0$ or $5$. Powers of $2$ end in $2, 4, 6$, or $8$, so only those ending in $2$ will give you a $5$ when you subtract $7$. Therefore $n = 5, 9, 13, \ldots, 4k+1, \ldots$

Don't often get a full solution this way, of course, but sometimes reductions like this will reveal more structure, or, if you're really lucky, cause a contradiction that rules out all integers above some bound.

-

$2^n=5mn+7$ implies $n$ divides $2^n-7$. Such numbers $n$ are tabulated at http://oeis.org/A033981, and they are few and far between: $1, 5, 25, 1727, 3830879, 33554425, 19584403931, 25086500333, 23476467919565,\dots$. By Zimul8r's answer, we also need $n$ to be 1 more than a multiple of 4, so that rules a few of these out, but a few of them should work. I would say that finding all solutions, or even determining whether there are infinitely many, is out of the question.

-
The presence of $5$, $25 = 2^5-7$ and $33554425=2^{25}-7$ suggest that if $n$ is such that $n\mid2^n-7$ then $2^n-7\mid 2^{2^n-7}-7$ as well. And I have verified computationally that $33554425\mid2^{33554425}-7$. Is there a way to prove this? It doesn't do much to solve the OP but it would mean that A033981 has an infinite number of possibilities to draw on. –  Peter Phipps Jun 22 '12 at 19:45