Prove that for all $n$ $\gcd(n, x_n)=1$, given $x_{n+1}=2(x_n)^2-1$ and $x_1=2$ I have a sequence $x_{n+1} = 2(x_n)^2-1$; first values are $2, 7, 97, 18817,\dots$
I noticed that if prime $p$ divides $x_n$, then $x_{n+1} \equiv -1\pmod p$ and for all $k>n+1$, $x_k\equiv 1\pmod p$. But I have no idea what to do next.

I'll do my usual playing around
and see what happens.
tl;dr - Nothing but dead ends.
If
$x_{n+1} 
= 2(x_n)^2-1
$
then
$x_{n+1} -1
= 2(x_n)^2-2
= 2(x_n^2-1)
= 2(x_n-1)(x_n+1)
$.
Therefore,
if $y_n =x_n-1$ then
$y_{n+1}
=2y_n(y_n+2)
$.
Since
$x_1 = 2$,
$y_1 = 1$.
Therefore
$y_2 = 2\cdot 1\cdot 3 = 6$,
$y_3 = 2\cdot 6\cdot 8= 96$,
$y_4 = 2\cdot 96\cdot 98 = 18616$,
and
$y_5 = 2\cdot 18616\cdot 18618 = 693185376$.
If we can show that
$n | y_n$,
then
$(n, x_n) = 1$
since,
if $d|n$ and $d|x_n$
and $d \ge 2$
then
$d | n | y_n$
so
$d | (x_n-1)$
implies
$d | 1$.
Unfortunately,
this doesn't work
as $y_5$ shows.
Next try:
see if can find
$a_n, b_n$ such that
$na_n-x_nb_n = 1$.
This will show that
$(n, x_n) = 1$.
If
$na_n-x_nb_n = 1$
and
$(n+1)a_{n+1}-x_{n+1}b_{n+1} = 1$
then
$\begin{array}\\
1
&=(n+1)a_{n+1}-(2x_n^2-1)b_{n+1}\\
&=na_{n+1}+a_{n+1}-2x_n^2b_{n+1}+b_{n+1}\\
&=na_{n}+n(a_{n+1}-a_n)+a_{n+1}-x_n(2x_nb_{n+1})+b_{n+1}\\
&=x_nb_n+1+n(a_{n+1}-a_n)+a_{n+1}-x_n(2x_nb_{n+1})+b_{n+1}\\
&=1+n(a_{n+1}-a_n)+a_{n+1}-x_n(2x_nb_{n+1}+b_{n})+b_{n+1}\\
\text{so}\\
0
&=n(a_{n+1}-a_n)+a_{n+1}-x_n(2x_nb_{n+1}+b_{n})+b_{n+1}\\
\end{array}
$
and I don't know where to go from here.
Hope someone else can make use of these.
