Prove that the equation $3^k = m^2 + n^2 + 1$ has infinitely many solutions in positive integers.
I have found that this is true for the first $k$'s from 1 to 7 except 3 and 6.
I have tried algebraic manipulation and induction too and it doesn't seem to work. I believe induction won't work since there are exceptions.
If I am correct, the numbers $m^2$ and $n^2$ can only be of the form $3a+1$.
Do you have any ideas about how I should proceed with this? I would love a few hints. Thanks.
EDIT(ELABORATION)
Note that $$(a^2+b^2)(c^2+d^2)=(ad+bc)^2+(ac-bd)^2 \tag{1}$$ Thus a product of two numbers that are a sum of $2$ squares is als0 a sum of two squares.
CLAIM
For all $t \in \mathbb{N}$, we have that $3^{2^{t}}-1$ is a sum of two squares.
PROOF
It is true when $t=1$ since $$3^{2}-1=2^2+2^2$$ Assume it is true when $t=a$. Note that for $t=a+1$, $$3^{2^{a+1}}-1=\left(3^{2^a} -1 \right) \left(3^{2^a}+1 \right)$$ By the inductive hypothesis, $3^{2^a} -1 $ is a sum of two squares. Also, $3^{2^a}+1$ is a sum of two squares from . Thus, the inductive hypothesis is true when $t=a+1$ from $(1)$. We are done. The result follows, as $k=2^{t}$.