TITLE: Primes in solutions to Pell-type equations
QUESTION [18 upvotes]: What is known about primes in solutions to Pell-type equations?
In particular, consider the negative Pell equation $x^2 - 5 y^2 = -1$.
As far as I've been able to check
(in the first $4000$ solutions) the only positive-integer solution with $y$ prime  is $x=38$, $y=17$,
but I don't see any obvious reason why this should be the case.

REPLY [3 votes]: The general solution of the negative Pell equation $\;x^2-5y^2=-1\;$ is the following
$\begin{cases}
x_n=\dfrac12\bigl[(2+\sqrt5)^{2n+1}+(2-\sqrt5)^{2n+1}\bigr]\\
y_n=\dfrac1{2\sqrt5}\bigl[(2+\sqrt5)^{2n+1}-(2-\sqrt5)^{2n+1}\bigr]
\end{cases}$
$\forall n\in\mathbb{N}\cup\{0\}\;.$
Since
$\begin{align}
2+\sqrt5&=\dfrac{16+8\sqrt5}8=\dfrac{1+3\sqrt5+15+5\sqrt5}8=\\
&=\left(\dfrac{1+\sqrt5}2\right)^3\;,
\end{align}$
$\begin{align}
2-\sqrt5&=\dfrac{16-8\sqrt5}8=\dfrac{1-3\sqrt5+15-5\sqrt5}8=\\
&=\left(\dfrac{1-\sqrt5}2\right)^3\;,
\end{align}$
it follows that
$y_n=\dfrac1{2\sqrt5}\left[\left(\dfrac{1+\sqrt5}2\right)^{6n+3}-\left(\dfrac{1-\sqrt5}2\right)^{6n+3}\right]$
$\forall n\in\mathbb{N}\cup\{0\}\;.$
Let $\;F_n =\dfrac1{\sqrt5}\left[\left(\dfrac{1+\sqrt5}2\right)^n-\left(\dfrac{1-\sqrt5}2\right)^n\right]\;$
be the $\;n^{\text{th}}\;$ Fibonacci number, then it results that
$\begin{align}
y_n&=\dfrac1{2\sqrt5}\left[\left(\dfrac{1+\sqrt5}2\right)^{6n+3}-\left(\dfrac{1-\sqrt5}2\right)^{6n+3}\right]=\\
&=\dfrac1{2\sqrt5}\left[\left(\dfrac{1+\sqrt5}2\right)^{2n+1}-\left(\dfrac{1-\sqrt5}2\right)^{2n+1}\right]\cdot\\
&\quad\quad\cdot\left[\left(\dfrac{1+\sqrt5}2\right)^{4n+2}-1+\left(\dfrac{1-\sqrt5}2\right)^{4n+2}\right]=\\
&=\dfrac1{2\sqrt5}\left[\left(\dfrac{1+\sqrt5}2\right)^{2n+1}-\left(\dfrac{1-\sqrt5}2\right)^{2n+1}\right]\cdot\\
&\quad\quad\cdot\left[\left(\dfrac{1+\sqrt5}2\right)^{4n+2}+2+\left(\dfrac{1-\sqrt5}2\right)^{4n+2}-3\right]=\\
&=\dfrac1{2\sqrt5}\left[\left(\dfrac{1+\sqrt5}2\right)^{2n+1}-\left(\dfrac{1-\sqrt5}2\right)^{2n+1}\right]\cdot\\
&\quad\quad\cdot\left\{\left[\left(\dfrac{1+\sqrt5}2\right)^{2n+1}-\left(\dfrac{1-\sqrt5}2\right)^{2n+1}\right]^2-3\right\}=\\
&=\dfrac12 F_{2n+1}\biggl(5F_{2n+1}^2-3\biggr)\quad\forall n\in\mathbb{N}\cup\{0\}\;.
\end{align}$
Hence,
$y_n\;$ is prime $\iff F_{2n+1}=2\iff n=1\;.$
Moreover,
$y_1=\dfrac12 F_3\biggl(5F_3^2-3\biggr)=\dfrac12\cdot 2\biggl(5\cdot 2^2-3\biggr)=17\;.$