A deceptively difficult linear recurrence problem Consider the sequence $b_0 = 0$, $b_1 = 1$, $b_{n+2} = 2b_{n+1} - 3b_n$ for all $n\geq 0$. Prove that the only positive integers $m$ with $b_m = \pm 1$ are $m = 1$ and $m = 3$. (In fact, I expect that $b_m = -1$ never occurs but not proving this is not an issue for the purpose described below.)
Calculating the first $50$ terms does not give much of a hint since the sequence is quite oscillating above and below $0$ and even $|b_n|$ is not monotonic all the time. An explicit formula is $b_n = (\sqrt{3})^n\frac{\sin(n \cdot \arctan \sqrt{2})}{\sqrt{2}}$ (derived by solving the characteristic equation etc.) but it does not really help me either.
(Interesting context: if one proves this, then it is not hard to prove, using $\mathbb{Z}[\sqrt{-2}]$, that the only positive integer solutions to $x^2 + 2 = 3^n$ are $(1,1)$ and $(5,3)$.)
Any help appreciated!
 A: We will work in the ring
$$ R=\Bbb Z[a]\ ,\qquad\text{ where } a=\sqrt{-2}\ .
$$
Then the characteristic equation of the given linear recursion is
$\lambda^2 -2\lambda +3=0$, it has the roots $(1+a)$ and $(1-a)$, both in $R$.
The general formula for $b_n$ is then:
$$
b_n =\frac 1{2a}\Big[\ (1+a)^n -(1-a)^n \ \Big]\ ,
$$
since it is true for $n=0$ and $n=1$, and since it is one and the same linear combination of the $n$-powers of the roots $(1\pm a)$. Let us assume there is some $n$ such that $b_n=\pm 1$. Then we have
$$
\pm 2a = (1+a)^n - (1-a)^n\ ,
$$
and thus $(1+a)^n$ is an element from $R$ of the shape
$$
y\pm 1\cdot a\ ,\qquad\text{ for some suitable } y\in \Bbb Z\ .
$$
Then we also know the conjugate, so the product is:
$$
3^n =(\ (1+a)(1-a)\ )^n=(1+a)^n(1-a)^n=(y+a)(y-a)=y^2-a^2 =y^2+2\ .
$$
This is a relation that lives in $\Bbb Z$, so let us see if it can be satisfied. To reduce some cases, although not needed, let us consider the above relation modulo $13$. Then $3$ has the multiplicative order three, since $3^3 =27=26+1\equiv 1$ modulo $13$. Its powers are $1,3,9$. Which powers are of the shape $x^2+2$ in $\Bbb F_{13}$?
$$
\begin{array}{|r|r|r|r|r|r|r|r|}
\hline
y & 0 & \pm 1 & \pm2 & \pm3 &\pm4 &\pm5 &\pm6
\\\hline
y^2 + 2 & 2 & 3 & 6 & 11 & 5 & 1 & 12
\\\hline
\end{array}
$$
So there is no match for the nine. Then $n$ is either $n=3m$ or $n=3m+1$.
In the first case, we have $y^2 = 3^{3m}-2$, in the second case after multiplication with nine $(3y)^2=3^{3(m+1)}-18$. So we obtain an integral point on the elliptic curve
$y^2=x^3-2$ or $Y^2=X^3 -18$. The integral points of these elliptic curves can be computed algorithmically, i am using sage:
sage: EllipticCurve(QQ, [0, -2]).integral_points()
....: EllipticCurve(QQ, [0, -18]).integral_points()
....: 
[(3 : 5 : 1)]
[(3 : 3 : 1)]

so let us see if the power-of-three condition for $x$, respectively $X$ is matched, oh, yes, indeed, (note that sage gives only the integral point with positive second component, except we explicitly claim we also want the other one... well, we know what we are doing...)

*

*the first point $(x,y)=(3,\pm5)$ on $y^2 = x^3-2$ corresponds to the solution $(\pm5)^2=3^3-2$, matching $3^n=y^2+2$ for $n=3$,

*the second point $(X,Y)=(3,\pm3)$ on $Y^2 = X^3-18$ corresponds to the solution $(\pm3)^2=3^3-18$, we take back the multiplication with nine, matching $3^n=y^2-2$ for $n=1$.

And indeed, we compute for $n=1$ and $n=3$ the values $b_1=1$, given,
$b_3=\frac 1{2a}(\ (1+a)^3-(1-a)^3\ )=\frac 1a(3a+a^3)=3+a^2=1$. (Or use the linear recursion to get $b_2=2b_1-3b_0=2-0=2$, $b_3=2b_2-3b_1=4-3=1$.)
$\square$
