Primes in solutions to Pell-type equations

Let $\alpha = (2 + \sqrt{5})$ and $\beta = (2 - \sqrt{5})$. Note that $\alpha \beta = -1$. The general solution is given by

$$y_n = \frac{\alpha^n - \beta^n}{\alpha - \beta} = \frac{\alpha^n -\beta^n}{2 \sqrt{5}}$$

for $n$ odd. (This follows from general theory and I could explain it but I suspect that you know --- you can use induction, for example). This is related to the fact that $\alpha$ is a unit in the ring $\mathbf{Z}[\sqrt{5}]$. However, what is secretly going on is that there is the larger ring $\mathbf{Z}[\phi]$ where

$$\phi = \frac{1 + \sqrt{5}}{2},$$

and in fact $\phi$ is the fundamental unit, and we have $\alpha = \phi^3$ and $\beta = -\phi^{-3}$. So

$$2 y_n = \frac{\phi^{3n} - (-\phi)^{-3n}}{\sqrt{5}}$$

is actually divisible by

$$ \frac{\phi^{n} - (-\phi)^{-n}}{\sqrt{5}} = F_n,$$

where $F_n$ is the $n$th Fibonacci number. (This divisibility takes place in $\mathbf{Z}[\phi]$, but the ratio $2y_n/F_n$ is a rational number which is an algebraic integer and thus an actual integer.) Hence $y_n$ is divisible by $F_n$ if $F_n$ is odd and by $F_n/2$ if $F_n$ is even (and the ratio is also $> 1$ for $n > 1$). This shows that $y_n$ is not prime as soon as $F_n > 2$, so for $n > 3$. Hence $y_3 = 17$ is the only prime value.

For more general Pell-type equations I think one is generally out of luck unless there are forced divisibilities as in this case, and looks similar to the primality or otherwise of the sequence $2^n - 1$.

Added: I guess for those who want a more elementary solution, one can observe (and prove by induction) that the $y$ are given by

$$\frac{1}{2} F_{6n+3} = \frac{F_{2n+1} \cdot (5 F^2_{2n+1} - 3)}{2}$$

and the RHS is easily seen to be prime only for $n = 1$ whence $F_9/2 = 34/2 = 17$.


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\;.$