I have a question concering the family of Pellian equations
$$x^2 - (k^2+1)y^2 = k^2. \qquad (\*)$$


For an integer $k\geq 2$, the equation (\*) has at least three classes of solutions
in integers, corresponding to the fundamental solutions
$(x\_0,y\_0) = (k, 0)$, $(k^2-k+1, k-1)$, $(k^2-k+1, -(k-1))$.
Each fundamental solution induces a sequence (class) of solutions by
$$ x+\sqrt{k^2+1}y = (x\_0+\sqrt{k^2+1}y\_0)(k+\sqrt{k^2+1})^{2m}. $$


For certain values of $k$, there are two additional classes
of solutions. E.g. for $k=2t^2$, we have also fundamental
solutions $(x\_0,y\_0) = (2t^3+t, \pm t)$, and additional
solutions occur also for $k=4s^3-4s^2+3s-1$,
for $k=F\_{2n}$, and other polynomial or exponential subfamilies.
However, I am not able to find any example such that (\*)
has more than five classes of solutions.


So, I am wondering does it make sense to state the conjecture
that for $k\geq 2$, equation `(*)` always have
exactly three or five classes of solutions
(e.g. 3 or 5 fundamental solutions).
Is there an obvious reason why should (or should not)
the number of fundamental solutions of (\*) be bounded
by an absolute constant (independent on $k$)?


It is easy to see that each fundamental solution $(x\_0,y\_0)$
has to satisfy $|y\_0| < k$, so the conjecture actually says
that there is at most one solution of equation (\*) with
$0 < y < k-1$.


This question is related to the conjecture which
says that there does not exist a set of four
positive integer with the property that the
product of any two of them is 1 greater than a square
(see e.g. [Section 3.1 of Diophantine m-tuples page](http://web.math.pmf.unizg.hr/~duje/dn.html "Section 3.1 of Diophantine m-tuples page")
and references given there).


Edit (2.10.2022): In the recent paper by Maohua Le and Anitha Srinivasan, the conjecture is verified for $k=p^m q^n$, where $p,q$ are distinct odd primes and $m,n$ are positive integers (see [https://web.math.pmf.unizg.hr/glasnik/forthcoming/pGM7053.pdf](https://web.math.pmf.unizg.hr/glasnik/forthcoming/pGM7053.pdf "preprint version of the paper")).



a family of Pellian equations
Oh, I think the answer is definitely yes!  
  

  

Let $\{k \to x,y\}$ be any solution of $x^2 - (k^2+1)y^2 = k^2$, and let $K$ be the set of $k$ for which a solution has $0 < k < y-1$. In a paper recently
submitted to *Glasnik Matematicki* we call these solutions
*exceptional* solutions. Andrej's conjecture is that for any $k$ there is at most 1 exceptional solution.
  
  
One interesting result we obtain is that, if $k \in K$, then
$y < (2 - \sqrt{3})k$.
  
  
A particular feature of this Pell equation is its symmetry wrt $k$ and $y$. These are interchangeable, so for any solution $\{k \to x,y\}$ there is a corresponding solution $\{y \to x,k\}$.
  
  

It follows that if $k \neq y \pm{1}$, then either $k \in K$ or $y \in K$.
  
  

Now, for any $k \geq 2$, we have 3 particular solution classes $(x\_n, y\_n)$ with
$y\_0 = \{0, k-1, -(k-1)\}$. For any $n > \{0, 0, 1\}$ we have $y\_n > k-1$
and so $\{y\_n \to x\_n,k\}$ is exceptional, ie. $y\_n \in K$.
  
  

We also need to consider $k=1$, for which there is just the one
class with $(x\_0, y\_0) = (1, 0)$ , $(x\_1, y\_1) = (3, 2)$ and so for
any $n > 1$ we have $y\_n \in K$. For example $(x\_2, y\_2) = (17, 12)$ from
which we obtain exceptional solution $\{12 \to 17, 1\}$, and so $12 \in K$.
  
  

In our paper we call the corresponding set of exceptional solutions
"Type 1". But here let us simply define the set $K\_1$ to be all of these
$y\_n > k$ that we find from these 3 classes for any $k > 1$, and
from the one class for $k = 1$.
  
  

One property shared by all type 1 solutions, ie $\{k \to x, y\}$ with $k \in K\_1$ is that either $(y^2 +1) | (x+y)$ or $(y^2 + 1) |(x-y)$.
  
  

Now, for any $k \in K\_1$ we have a corresponding $\{k \to x,y\}$ for
which our Pell eqn has 2 additional solution classes, with fundamental solutions
$(x\_0, y\_0) = (x, \pm y)$. For any $n > \{0,1\}$ we then have $y\_n > k-1$
and so $\{y\_n \to x\_n, k\}$ is exceptional, ie $y\_n \in K$.
  
  

And of course we can apply the same process to any of these new $y\_n$
*ad infinitum*, each $y\_n$ seeding a forest of others. For example,
just considering $n = 1$ alone in each case, from $\{8 \to 18,\pm{2}\}, 8 \in K\_1$ 
we obtain $\{546 \to 4402,8\}$ and $\{30 \to 242,8\}$, so $546, 30 \in K$,
and from $\{30 \to 242, \pm{8}\}$ we get $\{28928 \to 868322,242\}$ and
$\{112 \to 3362,30\}$, so $28928, 112 \in K$.
  
  

We call these "Type 2" solutions, so let's define $K\_2$ to be all of
the $y\_n$ found this way. These do not have the divisibility property that
was noted above for the $y\_n \in K\_1$.
  
  
In the paper we show that all 
exceptional solutions can be enumerated recursively in this
fashion, ie. that $K = K\_1 \cup K\_2$. This is done by showing any $k \in K$ can
be traced back to a root in $K\_1$.
  
  
The enumeration
algorithm is given below. Solution classes are referred to as $0, -1, +1$, the interpretation of which I hope is reasonably clear!
  
  



**Proc *Enum\_K:***  

> 
> Enum\_K1(1,0)  
>   
> 
> for k = 2 to $ \infty $  
> 
> > 
> > Enum\_K1(k, 0)  
> > 
> > Enum\_K1(k, +1)  
> > 
> > Enum\_K1(k, -1)
> 
> 


  
  

  
  

**Proc *Enum\_K1(k, class):***  

> 
> set $(x\_0, y\_0), (x\_1, y\_1)$ according to class  
> 
> n1 = if (class = -1 or k = 1) then 2 else 1  
>   
> 
> for n = n1 to $\infty$  
> 
> > 
> > add $y\_n$ to $K\_1$  
> > 
> > Enum\_K2($y\_n$, +1)  
> > 
> > Enum\_K2($y\_n$, -1)
> 
> 


  
  

  
  

**Proc *Enum\_K2(k, class):***  

> 
> set $(x\_0, y\_0), (x\_1, y\_1)$ according to class  
> 
> n1 = if (class = -1) then 2 else 1  
>   
> 
> for n = n1 to $\infty$  
> 
> > 
> > add $y\_n$ to $K\_2$  
> > 
> > Enum\_K2($y\_n$, +1)  
> > 
> > Enum\_K2($y\_n$, -1)
> 
> 


  
  

  
  

To generate the solution sequences in any class, we note that each class has the same
recurrence relation:
  

> 
> $R = 2k^2 + 1$  
> 
> $x\_n = 2Rx\_{n-1} - x\_{n-2}$  
> 
> $y\_n = 2Ry\_{n-1} - y\_{n-2}$  
> 
> 


  
but of course have different initial conditions:  

> 
> $R = 2k^2 + 1, S = 2k, D = k^2 + 1$  
>   
> 
> $K\_1, class 0: (x\_0, y\_0) = (k, 0), (x\_1, y\_1) = (kR, kS)$  
> 
> $K\_1, class +: (x\_0, y\_0) = (k^2-k+1, k-1)$  
> 
> $K\_1, class -: (x\_0, y\_0) = (k^2-k+1,1-k)$  
> 
> $K\_2, class +: (x\_0, y\_0) = (x\_n, +y\_n)$ for any $y\_n \in K\_1 \cup K\_2$  
> 
> $K\_2, class -: (x\_0, y\_0) = (x\_n, -y\_n)$ " "  
> 
>   
> and in all cases above $(x\_1, y\_1)$ satisfy  
> 
> > 
> > $x\_1 = Rx\_0 + DSy\_0$  
> > 
> > $y\_1 = Ry\_0 + Sx\_0$  
> > 
> > 
> 
> 


  
  

  
  

Now if Andrej's conjecture is true, and we believe it is, then each operation "*add* $y\_n$" always adds a new $y\_n$ to its list, and the two lists $K\_1, K\_2$ have
no common elements.
  
  

An implementation of *Enum\_K* with a bailout parameter finds
that with $k <10^6$ we have $|K\_1| = 882, |K\_2| = 163, |K| = 1045$, and 
that every $k$ enumerated was unique. This agrees with Andrej's figure.
  
  



