How can I find all integer solutions of $3^n - x^2 = 11$ I know that $n$ can't be even because of the following argument:
Let $n = 2p$. Then we can use the difference of two squares and it becomes like this :
$(3^p + x)(3^p - x) = 11; 3^p + x = 11 , 3^p - x = 1$. $3^p = 6$ which is not possible if $p$ is an integer.
I also found out that $x$ has to be an even number. I think that the only solution is $3^3 - 4^2 = 11$ but how can I find the true answer?
 A: $$3^{n} - x^2 = 11$$
According to Silverman's answer, we take the three cases $n=3a, n=3a+1,$ and $n=3a+2.$
The problem can be reduced to finding the integer points on elliptic curves as follows.
$\bullet n=3a$
Let $X = 3^a, Y=x$, then we get  $Y^2 = X^3 - 11.$
According to LMFDB, this elliptic curve has integer points $(X,Y)=(3,\pm 4), (15,\pm 58)$ with rank $2.$
Hence $(X,Y)= (3,\pm 4) \implies  (n,x)=(3,\pm4).$
$\bullet n=3a+1$
Let $X = 3^{a+1}, Y=3x$, then we get $Y^2 = X^3 - 99.$
This elliptic curve has rank $0$ and has no integer point, so there is no integer solution $(n,x).$
$\bullet n=3a+2$
Let $X = 3^{a+2}, Y=9x$, then we get    $Y^2 = X^3 - 891.$
This elliptic curve has integer points $(X,Y)=(31,\pm 170)$ with rank $1.$
Hence there is no integer solution $(n,x).$
Thus, there are only integer solutions $(n,x)=(3,\pm4).$
A: One way to do this (probably not the easiest, but generalizes quite nicely) is to write $n=3m+r$ with $r\in\{0,1,2\}$. Then you have a solution $(x,3^m)\in\mathbb Z^2$ to
$$ 3^r\cdot y^3 - x^2 = 11. $$
So you just need to find the integer points on the three elliptic curves
$$ y^3-x^2=11,\quad 3y^3-x^2=11,\quad 9y^3-x^2=11. $$
There are standard methods for handling such curves.
