I finally solved the question.
Here is the if part.
Suppose that
$$
\Delta =
\det {
\begin{bmatrix}
A & B & D \\
B & C & E \\
D & E & F \\
\end{bmatrix}
}
= ACF + 2BED - (AE^2 + CD^2 + FB^2) = 0.
$$
The proof splits into a few cases.
(a)
$A = B = C = 0$.
Then
$$
\begin{aligned}
f(x, y)
= 2Dx + 2Ey + F
= (0x + 0y + 1)(2Dx + 2Ey + F).
\end{aligned}
$$
(b)
$A = C = 0$, but $B \neq 0$.
Then
$$
\begin{aligned}
f(x, y)
= {} & 2Bxy + 2Dx + 2Ey + F \\
= {} & \frac{2}{B}(Bx \cdot By + D \cdot Bx + E \cdot By) + F \\
= {} & \frac{2}{B}(Bx \cdot By + D \cdot Bx + E \cdot By + DE - DE) + F \\
= {} & \frac{2}{B}(Bx \cdot By + D \cdot Bx + E \cdot By + DE) - \frac{2}{B} \cdot DE + F \\
= {} & \frac{2}{B}(Bx + E)(By + D) - \frac{2ED - FB}{B} \\
= {} & \left(1x + 0y + \frac{E}{B}\right)(0x + 2By + 2D) - \frac{2BED - FB^2}{B^2}.
\end{aligned}
$$
Since $\Delta = 0$ and $A = C = 0$,
$$
\begin{aligned}
\Delta = 0 + 2BED - (0 + 0 + FB^2) = 2BED - FB^2 = 0.
\end{aligned}
$$
We conclude that
$$
\begin{aligned}
f(x, y) = \left(1x + 0y + \frac{E}{B}\right)(0x + 2By + 2D).
\end{aligned}
$$
(c)
$A \neq 0$.
Then
$$
\begin{aligned}
& f(x, y) \\
= {} & Ax^2 + 2(By + D)x + (Cy^2 + 2Ey + F) \\
= {} & \frac{(Ax + By + D)^2 - (By + D)^2}{A}
+ (Cy^2 + 2Ey + F) \\
= {} & \frac{1}{A} (Ax + By + D)^2 + \frac{1}{A}((AC - B^2)y^2 + 2(AE - BD)y) + \frac{AF - D^2}{A}.
\end{aligned}
$$
The case splits into two subcases.
(c.1)
$AC - B^2 = 0$.
Hence $C = \frac{B^2}{A}$.
Hence
$$
\begin{aligned}
\Delta
= {} & A \cdot \frac{B^2}{A} \cdot F + 2BED - AE^2
- \frac{B^2 D^2}{A} - FB^2 \\
= {} & {-\frac{1}{A}}
(A^2 E^2 - 2AE BD + B^2 D^2) \\
= {} & {-\frac{1}{A}} (AE - BD)^2.
\end{aligned}
$$
Since $\Delta = 0$,
we have $AE - BD = 0$.
Hence
$$
\begin{aligned}
f(x, y) = \frac{(Ax + By + D)^2 - (D^2 - AF)}{A}.
\end{aligned}
$$
There exists a complex number $d$ such that $d^2 = D^2 - AF$.
Hence
$$
\begin{aligned}
f(x, y) = \frac{1}{A} (Ax + By + D + d)(Ax + By + D - d),
\end{aligned}
$$
which is
$$
\begin{aligned}
f(x, y) = \left( 1x + \frac{B}{A} y + \frac{D+d}{A} \right) (Ax + By + (D - d)).
\end{aligned}
$$
(c.2)
$AC - B^2 \neq 0$.
Then
$$
\begin{aligned}
& (AC - B^2) y^2 + 2(AE - BD)y
\\
= {} & \frac{1}{AC - B^2} ((AC - B^2)y + (AE - BD))^2 - \frac{(AE - BD)^2}{AC - B^2}.
\end{aligned}
$$
Hence
$$
\begin{aligned}
f(x, y)
= {} & \frac{(Ax + By + D)^2}{A} - \frac{((B^2 - AC)y + (BD - AE))^2}{A(B^2 - AC)}
\\
& \quad
+ \frac{AF - D^2}{A} - \frac{(AE - BD)^2}{A(AC - B^2)},
\end{aligned}
$$
which is just
$$
\begin{aligned}
f(x, y) = \frac{(Ax + By + D)^2}{A} - \frac{((B^2 - AC)y + (BD - AE))^2}{A(B^2 - AC)} + \frac{\Delta}{AC - B^2}.
\end{aligned}
$$
Since $\Delta = 0$,
$$
\begin{aligned}
f(x, y) = \frac{(Ax + By + D)^2}{A} - \frac{((B^2 - AC)y + (BD - AE))^2}{A(B^2 - AC)}.
\end{aligned}
$$
There exists a complex number $e$ such that $e^2 = B^2 - AC$.
Put $f = \frac{BD-AE}{e}$.
Then
$$
\begin{aligned}
f(x, y)
= {} & \frac{(Ax + By + D)^2}{A} - \frac{(e^2 y + ef)^2}{Ae^2} \\
= {} & \frac{(Ax + By + D)^2}{A} - \frac{(ey + f)^2}{A} \\
= {} & \frac{1}{A}(Ax + By + D + ey + f)(Ax + By + D - ey - f) \\
= {} & \left( 1x + \frac{B+e}{A}y + \frac{D+f}{A} \right) (Ax + (B-e)y + (D-f)).
\end{aligned}
$$
(d)
$C \neq 0$.
We rewrite $f(x, y)$ as
$$
\begin{aligned}
Cy^2 + 2Byx + Ax^2 + 2Ey + 2Dx + F.
\end{aligned}
$$
Put
$$
\begin{aligned}
g(x, y) = Cx^2 + 2Bxy + Ay^2 + 2Ex + 2Dy + F,
\end{aligned}
$$
which means that for any ordered pair of complex numbers $(z, w)$,
$$
\begin{aligned}
g(z, w) = f(w, z).
\end{aligned}
$$
A straightforward computation show that
$$
\begin{aligned}
\Delta'
= {} &
\det {\begin{bmatrix}
C & B & E \\
B & A & D \\
E & D & F \\
\end{bmatrix}} \\
= {} & CAF + 2BDE - (CD^2 + AE^2 + FB^2) \\
= {} & ACF + 2BED - (AE^2 + CD^2 + FB^2) \\
= {} & \Delta.
\end{aligned}
$$
By (c), there exist six complex numbers
$a_1$, $a_2$, $a_3$, $a_4$, $a_5$, $a_6$
such that
$$
\begin{aligned}
g(x, y) = (a_1 x + a_2 y + a_3) (a_4 x + a_5 y + a_6).
\end{aligned}
$$
Hence
$$
\begin{aligned}
&
f(x, y) = g(y, x) = (a_2 x + a_1 y + a_3) (a_5 x + a_4 y + a_6).
\end{aligned}
$$
Best Answer
We show that $$\gcd(a_n,a_{n-1})=1$$first notice that all the terms of the sequence are odd (because $2^{\gcd(a,b)}$ is always even and $a_1$ and $a_2$ are odd and non-zero) therefore $$\gcd(a_n,a_{n-1})=\gcd(2^{\gcd(a_{n-2},a_{n-3})}+a_{n-1},a_{n-1})=\gcd(2^{\gcd(a_{n-2},a_{n-3})},a_{n-1})=1$$since $2^{\gcd(a_{n-2},a_{n-3})}$ is a power of $2$ and has no odd component. Therefore $\gcd(a_n,a_{n-1})=1$ which leads to $$a_n=2+a_{n-1}$$or $$a_n=2n-5$$