<s>[INST] If $n,k\in\mathbb N$, solve $3^k-1=x^n$. If $n,k\in\mathbb N$, solve $$3^k-1=x^n$$
This seems like an interesting problem. I've currently tried a few things (one could try a lot of things in this case):
$1)$ $x^n\equiv -1\pmod 3\Rightarrow x\equiv -1\pmod 3\Rightarrow n=2r+1$, where $r\in\mathbb N\cup\{ 0\}$.
Which brings us to $3^k-1=x^{2r}x$.
$2)$ $2\mid 3^k-1$, so $x^{2r}x$ is divisible by $2$.
$3)$ By checking congruence modulo $4$, we see that $k=2m$, where $m\in\mathbb N$.
Thus $(3^m+1)(3^m-1)=x^{2r}x$. That's just a few things we could try.
 [/INST] Since $n$ is odd, it has some odd prime divisor $p$, or is $1$, if it is $1$, we have an infinite family of trivial solutions. Since if we care of only prime $n$ we are done (why?), let's suppose $n=p$.
$$3^k=(x+1)(1-x+x^2-x^3\cdots)$$
And since $x\equiv 2 \pmod{3}$, the residues on the right parentheses $\pmod3$ look like
$$1+\underbrace{-2+1+-2+1\cdots}_\text{p-1 times}\equiv 1+\underbrace{1+1+1\cdots}_\text{p-1 times}\equiv p \pmod{3}$$
Therefore we want that $p$ is a multiple of $3$, therefore $p=3$
So finally we have $x^2-x+1=3(3q^2-3q+1)$. Since the parentheses is not divisible by $3$, and it must be a power of $3$, it must be $1$. So we have $3q(q-1)=0 \iff q=0,1$. $q=0$ does not work.
Therfore the only solution is $x=3q-1=2$, $n=3$, $k=2$
</s>