# Is there a general method to find integer x,y solutions to $A^x=B^y-1$?

## Problem

For the equation:

$$12^x=5^y-1$$

I want to prove it has no solutions with x,y being positive integers.

## Question

Is there a general method for solving this type of equation? (It looks vaguely like a Pell equation, but not close enough that I can see how to solve it with standard methods)

If not, is there an elegant method to prove it for the particular case here (with $$A=12$$ and $$B=5$$)?

## What I've tried

Thinking modulo 12, the LHS = 0, and the RHS is 0 if and only if y is even. Writing $$y=2z$$, I can then factorize the RHS into $$(5^z+1)(5^z-1)$$

Both factors are even and by thinking modulo 3, only one of these factors can be divisible by 3. So I conclude that I need something like $$5^z+1=2^?3^x$$ and $$5^z-1=2^?$$ or vice versa.

Subtracting these equations I need $$2=2^?3^x-2^?$$.

If I now think in binary, these equations look like $$10_2 = (11_2)^x100..00_2 - 100...00_2$$.

It seems to make sense (but I don't see how to mathematically express this idea) that the only way this equation will work is as $$5^1+1=2.3$$ and $$5^1-1=2.2$$ but this solution results in a LHS of 24, which is not a power of 12.

However, I feel there must be a less convoluted proof!

• what is $\gcd(5^z - 1, 5^z + 1)?$ – Will Jagy Oct 11 '16 at 20:15
• Two, so this certainly cuts down the options for the factors a great deal (as one factor must have just a single 2). Is there more I should conclude? – Peter de Rivaz Oct 11 '16 at 20:18
• Mihăilescu's theorem kills all of these problems. – Fan Zheng Oct 11 '16 at 20:20
• that should be enough. Meanwhile, over the past few days I have been fiddling with questions such as $7^x - 3^y = 100,$ there seems to be a procedure but it is not easy math.stackexchange.com/questions/1946621/… – Will Jagy Oct 11 '16 at 20:21

As an illustration, let us solve $3^A - 2^B = 1,$ which will finish the other answer. We suspect the largest solution is $9-8=1.$ Take $3^A = 2^B + 1$ and subtract $9$ from both sides, for $3^A - 9 = 2^B - 8.$ Divide out both factors and introduce new variables, for $$9 (3^x - 1) = 8(2^y - 1).$$ We will show that this is impossible with $x,y \geq 1.$

Little explanation: given $m,n \geq 2$ with $\gcd(m,n) = 1,$ we know that $m^{\varphi(n)} \equiv 1 \pmod n.$ However, there may be a smaller $k$ with $m^{k} \equiv 1 \pmod n.$ If so, we take the smallest such $k$ and call it the order, sometimes multiplicative order, of $m \pmod n.$

We proceed under the assumption that $x \geq 1$ and $y \geq 1.$

Now, $2^y \equiv 1 \pmod 9.$ This means that $$6 | y.$$

jagy@phobeusjunior:~$./order 2 9 9 6 = 2 * 3  Furthermore,$2^6 - 1 | 2^y - 1.$$$2^6 - 1 = 63 = 3^3 \cdot 7.$$ Therefore$7 | (3^x - 1),$$$3^x \equiv 1 \pmod 7.$$ Therefore $$6 | x,$$ and$3^6 - 1$divides$3^x - 1.$jagy@phobeusjunior:~$ ./order 3 7
7     6 = 2 * 3


$$3^6 - 1 = 8 \cdot 7 \cdot 13.$$

Therefore $$2^y \equiv 1 \pmod {13},$$ $$12 | y.$$

jagy@phobeusjunior:~$./order 2 13 13 12 = 2^2 * 3  In particular $$4 | y,$$ and$2^y - 1$is divisible by$15,$especially divisible by$5.$$$3^x \equiv 1 \pmod 5,$$ so $$4 | x.$$ jagy@phobeusjunior:~$ ./order 3 5
5     4 = 2^2


However, $$3^4 - 1 = 80 = 5 \cdot 16.$$ This means that $8 (2^y - 1)$ is divisible by $16,$ a contradiction of $$9 (3^x - 1) = 8(2^y - 1)$$ with $x,y \geq 1.$

The powers of $5$ mod $11$ are $5,3,4,9$, and $1$. Thus $5^y-1\in\{4,2,3,8,0\}$ mod $11$. But $12^x\equiv1^x=1$ mod $11$. So $12^x=5^y-1$ can have no solutions in positive integers.

Remark (added later, on reading the question's request for a general method): A key feature of the equation $12^x=5^y-1$ that makes a simple congruence-based approach possible is the fact that we're proving the equation has no solutions. For equations like $2^x=3^y-1$ (see Will Jagy's excellent answer), where you're trying to prove it has just one solution, a simple congruence-based approach doesn't have a chance.

If $y$ is odd then $5^y-1=1 \pmod 3$ while $12^x=0 \pmod 3$. So there are no solutions whit $y$ odd.

Let $y=2z$. Then the equation is $12^x=25^z-1$. Thinking$\pmod {13}$, the left hand side is $1$ or $-1$ while the right hand side is $0$ or $2$. Then there are no solutions with $y$ even, and therefore no solutions at all.

That one is easy, clearly $y=1$ has no solutions.

working $\bmod 3$ we get $y$ is even, so $y=2k$ with $k\geq 1$.

From here $12^x=5^{2y}-1=(5^y+1)(5^y-1)$.

Clearly one factor must be $2\times 3^x$ and the other must be $4^{x-1}\times 2$.

Therefore we have $2\times 3^x=4^{x-1}\times 2+2$ or $2\times 3^x=4^{x-1}\times 2 -2$

The first is equivalent to $3^x=4^{x-1}+1$ and the second is equivalent to $3^x=4^{x-1}-1$.

It is easy to see neither have solutions by looking at the following table:

$$\begin{pmatrix} 1 & 1 \\ 3 & 4 \\ 9 & 16\\ 27 & 64\\ 81 & 256\\ 243 & 1024\\ \end{pmatrix}$$

• I do not understand how the table means there are no solutions, can you explain more? – Peter de Rivaz Oct 11 '16 at 20:46
• @PeterdeRivaz I put a proof about $3^A - 2^B = 1$ as an answer. – Will Jagy Oct 11 '16 at 22:48