Intereting Posts

How to bound this integral?
Applying the Lagrangian function to find critical points
Geometric Interpretation of Total Derivative?
How do I prove that any chessboard of size $n \times 3$, where n is even and $n \geq 10$, has a closed knight's tour?
Proof for an equality involving square roots
Lie algebra and left-invariant vector fields
The limit of a recurrence relation (with resistors)
At most one subgroup of every order dividing $\lvert G\rvert$ implies $G$ cyclic
Prove that a non-positive definite matrix has real and positive eigenvalues
Combinatorial proof of $\sum_{k=0}^{n} \binom{n+k-1}{k} = \binom{2n}{n}$
How to show that $ \sum_{n = 0}^{\infty} \dfrac {1}{n!} = e $
Part of simple proof of nontrivial center in p-group
Derivative of determinant of a matrix
Probability of first and second drawn balls of the same color, without replacement
Power of prime ideal

If $x$ and $y$ are positive integers, then when is $2^x+3^y$ a perfect square?

I tried this question a lot but failed. I tried dividing cases into when $x,y$ are even/odd, but still have no idea what to do when they are both odd. I tried looking into when is $2^x+3^y$ is of the form $6k+1$ and so on .. but couldn’t succeed. Can anyone help?

- 2 is a primitive root mod $3^h$ for any positive integer $h$
- Olympiad calculus problem
- $\mathrm{lcm}(1, 2, 3, \ldots, n)$?
- Help me solve this olympiad challenge?
- Least wasteful use of stamps to achieve a given postage
- How to do well on Math Olympiads

- Is 0.9999… equal to -1?
- Prove that $x^{2} \equiv 1 \pmod{2^k}$ has exactly four incongruent solutions
- Sum of n consecutive numbers
- Primitive roots of unity
- Why is the last digit of $n^5$ equal to the last digit of $n$?
- HINT for summing digits of a large power
- Are products of powers of 2 and powers of 3 dense in the nonnegative reals?
- Number of ways to express a number as the sum of different integers
- Characterize the integers $a,b$ satisfying: $ab-1|a^2+b^2$
- Prove that none of $\{11, 111, 1111,\dots \}$ is the perfect square of an integer

Hint: Note that $x$ is even (work modulo $3$). Let $x=2s$. We are solving

$$3^y=(z-2^s)(z+2^s).$$ Each term on the right is a power of $3$. But their difference is a power of $2$, and we are down to the familiar equation $3^y=2^{s+1}+1$.

If $x=1$, $2+3^y$ cannot be a square since it is $\equiv 2\pmod{3}$.

This gives $x\geq 2$, so $2^x+3^y\equiv (-1)^y\pmod{4}$ and $y$ must be even. Since in this case $3^y\equiv 1\pmod{8}$, we must have $x\geq 3$ and

$$ 2^x + 3^{2z} = A^2 $$

with $A$ odd, or:

$$ 2^x = (A-3^z)(A+3^z) \tag{1} $$

so both $A-3^x$ and $A+3^x$ must be powers of two, then:

$$ 2\cdot 3^z = 2^D-2^C\tag{2} $$

with $D>C$ and $C\geq 1$, since otherwise the RHS of $(2)$ is odd. But if $C>1$ then the RHS of $(2)$ is a multiple of four while the LHS is not, so $C=1$ and we are left with:

$$ 3^z = 2^E -1 \tag{3} $$

where $E$ must be even in order that the RHS is a multiple of three. But in such a case the only solution of:

$$ 3^z = (2^F-1)(2^F+1) \tag{4} $$

is given by $z=F=1$, since otherwise $2^F-1$ and $2^F+1$ cannot be both powers of three.

This gives that

$$ 2^4+3^2 = 5^2 $$

is the only solution.

Let $2^x+3^y=k^2$.

mod $3$ gives $x=2m$ for some $m\in\mathbb Z^+$, since $(-1)^x\equiv k^2\pmod {3}$ and since $2$ (i.e. $-1$) is not a quadratic residue mod $3$.

More generally, $\left(\frac{-1}{p}\right)=1\iff p\equiv 1\pmod {4}$, where $p$ is an odd prime and $\left(\frac{a}{b}\right)$ is the Legendre symbol.

Thus $4^m+3^y=k^2$.

So $(-1)^y\equiv k^2\pmod {4}$, but $\left(\frac{-1}{4}\right)=-1$. So $y=2n$ for some $n\in\mathbb Z^+$.

Thus $(2^{m})^2+(3^n)^2=k^2$.

Hence $(2^m,3^n,k)$ is a Pythagorean triple. Moreover, it is primitive, because $(2^m,3^n)=1$, which means:

$$\begin{cases}2^m=2ab\\3^n=a^2-b^2\\k=a^2+b^2\end{cases},$$

where exactly one of $a,b$ is odd.

This implies $(a,b)=(2^i,2^j)$ for some $i,j\in\mathbb Z^+$.

But exactly one of $a,b$ is odd (as I said before), and also $a>b\iff 2^i>2^j$.

Thus $j=0$ so that $(a,b)=(2^i,1)=(2^{m-1},1)$.

Then $4^{m-1}=3^n+1\iff (2^{m-1}-1)(2^{m-1}+1)=3^n$ so that $2^{m-1}-1$ and $2^{m-1}+1$ are powers of $3$, and because their difference is $2$, it follows that $2^{m-1}-1=1\iff m=2\iff x=4$, and $n=1\iff y=2$, which leads us to the only solution $(x,y)=(4,2)$, which after checking works.

The following is an alternative continuation of my solution using Zsigmondy’s theorem.

We have $4^{m-1}=3^n+1$ ($n$ is odd (check $\pmod 4$ and note that $m-1\ge 1$)), but Zsigmondy’s theorem implies:

$$\exists p\in\mathbb P (p\mid a^n+b^n\wedge p\not\mid a+b), \forall n\ge 2, a>b$$ (with the exception of $(a,b,n)=(2,1,3)$, which won’t work here, since in our case $(a,b,n)=(3,1,n)$) so that $a^n+b^n$ has more than one prime divisor for any $n\ge 2, a>b$.

Thus $n\ge 2$ and $3>1$ lead to a contradiction, which means $n=1\iff y=2$ and $m=2\iff x=4$.

This leads to $(x,y)=(4,2)$ as the only solution, which after checking works.

Yet another way I could’ve proceeded after seeing that $4^{m-1}=3^n+1$ is Catalan’s conjecture (now proved), which tells us that $$\begin{cases}x^a-y^b=1\\x,a,y,b\in\mathbb Z_{>1}\end{cases}\iff (x,a,y,b)=(3,2,2,3)$$

Continuation of André Nicolas solution using Zsigmondy’s theorem.

$3^y=2^{s+1}+1$.

Notice that $y\ge 1$ so that $s+1\ge 1$. Applying Zsigmondy’s theorem leads to a contradiction whenever $s+1\ge 2$ and $2>1$ except for the exception $s+1=3$, which means either $s+1=1\iff (x,y)=(0,1)$, which doesn’t work, or $s+1=3\iff s=2$, giving us the only solution $(x,y)=(4,2)$, which after checking works.

This could’ve also been solved using Catalan’s conjecture (now proved), which I introduced above.

But, of course, the easiest route here is to note that (we have $y\ge 1$ and thus $s+1\ge 1$, but $s+1\neq 1$, so $s+1\ge 2$. Now assume $s+1\ge 2$) $\pmod{4}$ leads to $y=2c$ for some $c\in\mathbb Z^+$ so that $(3^c-1)(3^c+1)=2^{s+1}$ and thus $3^c-1=2\iff c=1\iff y=2$ and thus $s+1=3\iff s=2\iff x=4$.

It follows that $(x,y)=(4,2)$ is the only possible solution and after checking it it works.

- Looking for a source of an infinite trigonometric summation and other such examples.
- When will $A$ satisfy the dimension formula?
- About Rayleigh's formula
- Least Square Approximation for Exponential Functions
- Cancelling matrices
- Higher homology group of Eilenberg-Maclane space is trivial
- How to differentiate product of vectors (that gives scalar) by vector?
- Determine if projection of 3D point onto plane is within a triangle
- If $xy$ is a unit, are $x$ and $y$ units?
- A function for which the Newton-Raphson method slowly converges?
- Calculating the eigenvalues of a matrix
- Integrable but not differentiable function
- Universal Cover of $SL_{2}(\mathbb{R})$
- Evaluating the integral with trigonometric integrand
- Is the class of subsets of integers countably infinite?