The quadratic diophantine $ k^2 - 1 = 5(m^2 - 1)$ Here's the problem.
Find the solutions of the following equation:
$$ k^2 - 1 = 5(m^2 - 1).$$

Here's my idea:
The original equation can be written as:
$$ k^2 = 5m^2 - 4 \Longleftrightarrow k^2 - 5m^2 = -4$$
I know this is Quadratic Diophantine Equation and i've done some searching on the internet and I couldn't find a particular way for solving equations of this type. Also I know that this is a varition of Pell's equation, because instead of 1 we have -4.
I actually found the fundamental solution to this equation (by guessing) and it's (1,1). Then using this algorithm (that works for Pell's equation) I tried to generate another solution and I get:
$$ X_k+_1 = aX_k + nbY_k$$
$$ X_2 = aX_1 + nbY_1$$
$$ X_2 = 1 \times 1 + 5 \times 1 \times 1 = 6$$
$$ Y_k+_1 = bX_k + aY_k$$
$$ Y_2 = bX_1 + aY_1$$
$$ Y_2 = 1 \times 1 + 1 \times 1 = 2$$
We can easily check that (6,2) isn't a solution.
So how can I transform a Quadratic Diophantine Equation into a Pell's equatuon and how can I generate more solution for Pell's equation if the constant isn't 1 (in this case it's -4)?
 A: Here is the version from J. H. Conway's book, The Sensual Quadratic Form. What I do is add in the value of the quadratic form at the point in question, here in a color that is supposedly called fuchsia, then draw, as a column vector in green, the point in question. The main theorem is pages 20-23 of the book, the river is periodic. With my extra labelling, you can also see the automorph matrix $A$ at the second occurence of the form $\langle 1,0,-5 \rangle,$ as this $1$ happens at the column vector with entries $(9,4),$ then the $-5$ occurs at the column vector with entries $(20,9).$
Let's see, this is quite visual. It is probably most reasonable to say that the primitive representations of $-4$ have two representatives in each period, here given by $(1,1)$ and then $(11,5).$ In comparison, the representations of $-1$ happen only once per period, $(2,1),$ so the imprimitive representations of $-4$ come from $(4,2).$ For both primitive and imprimitive, all representations then occur using the automorph to jump from one period to the next. 
Lagrange's "reduced" forms occur exactly where the value crosses the river, The value in yellow and the little arrow tell you what the equivalent form is: the reduced ones are, only,  $\langle 1,4,-1 \rangle,$ and   $\langle -1,4,1 \rangle.$ What this says is that the value $-4$ would not be found by continued fractions for $\sqrt 5.$
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
A: $$ A = 
 \left(  \begin{array}{cc}
  9  &  20  \\
   4   &  9  
\end{array} 
  \right)  ,
 $$ and 
$$ A^{-1} = 
 \left(  \begin{array}{cc}
  9  &  -20  \\
   -4   &  9  
\end{array} 
  \right).
 $$ 
$$  
 \left(  \begin{array}{cc}
  9  &  20  \\
   4   &  9  
\end{array} 
  \right)  
 \left(  \begin{array}{c}
  1  \\
   1  
\end{array} 
  \right) =
 \left(  \begin{array}{c}
  29  \\
   13  
\end{array} 
  \right), 
 $$
$$  
 \left(  \begin{array}{cc}
  9  &  20  \\
   4   &  9  
\end{array} 
  \right)  
 \left(  \begin{array}{c}
  29  \\
   13  
\end{array} 
  \right) =
 \left(  \begin{array}{c}
  521  \\
   233  
\end{array} 
  \right), 
 $$
$$  
 \left(  \begin{array}{cc}
  9  &  20  \\
   4   &  9  
\end{array} 
  \right)  
 \left(  \begin{array}{c}
  521  \\
   233  
\end{array} 
  \right) =
 \left(  \begin{array}{c}
  9349  \\
   4181  
\end{array} 
  \right), 
 $$
Switching to $-A^{-1},$ we get
$$  
 \left(  \begin{array}{cc}
  -9  &  20  \\
   4   &  -9  
\end{array} 
  \right)  
 \left(  \begin{array}{c}
  1  \\
   1  
\end{array} 
  \right) =
 \left(  \begin{array}{c}
  11  \\
   -5  
\end{array} 
  \right), 
 $$
$$  
 \left(  \begin{array}{cc}
  -9  &  20  \\
   4   &  -9  
\end{array} 
  \right)  
 \left(  \begin{array}{c}
  11  \\
   -5  
\end{array} 
  \right) =
 \left(  \begin{array}{c}
  -199  \\
   89  
\end{array} 
  \right), 
 $$
$$  
 \left(  \begin{array}{cc}
  -9  &  20  \\
   4   &  -9  
\end{array} 
  \right)  
 \left(  \begin{array}{c}
  -199  \\
   89  
\end{array} 
  \right) =
 \left(  \begin{array}{c}
  3571  \\
   -1597  
\end{array} 
  \right), 
 $$
If you want to allow common factors,
$$  
 \left(  \begin{array}{cc}
  9  &  20  \\
   4   &  9  
\end{array} 
  \right)  
 \left(  \begin{array}{c}
  4  \\
   2  
\end{array} 
  \right) =
 \left(  \begin{array}{c}
  76  \\
   34  
\end{array} 
  \right), 
 $$
$$  
 \left(  \begin{array}{cc}
  9  &  20  \\
   4   &  9  
\end{array} 
  \right)  
 \left(  \begin{array}{c}
  76  \\
  34  
\end{array} 
  \right) =
 \left(  \begin{array}{c}
  1364  \\
   610  
\end{array} 
  \right), 
 $$
$$  
 \left(  \begin{array}{cc}
  9  &  20  \\
   4   &  9  
\end{array} 
  \right)  
 \left(  \begin{array}{c}
  1364  \\
   610  
\end{array} 
  \right) =
 \left(  \begin{array}{c}
 24476  \\
 10946  
\end{array} 
  \right). 
 $$
Switching to $-A^{-1},$ we get
$$  
 \left(  \begin{array}{cc}
  -9  &  20  \\
   4   &  -9  
\end{array} 
  \right)  
 \left(  \begin{array}{c}
  4  \\
   2  
\end{array} 
  \right) =
 \left(  \begin{array}{c}
  4  \\
   -2  
\end{array} 
  \right), 
 $$
$$  
 \left(  \begin{array}{cc}
  -9  &  20  \\
   4   &  -9  
\end{array} 
  \right)  
 \left(  \begin{array}{c}
  4  \\
   -2  
\end{array} 
  \right) =
 \left(  \begin{array}{c}
  -76  \\
   34  
\end{array} 
  \right), 
 $$
$$  
 \left(  \begin{array}{cc}
  -9  &  20  \\
   4   &  -9  
\end{array} 
  \right)  
 \left(  \begin{array}{c}
  -76  \\
   34  
\end{array} 
  \right) =
 \left(  \begin{array}{c}
  1364  \\
   -610  
\end{array} 
  \right), 
 $$
so you see nothing new happens this time. 
A: Hint: Consider $\left(1+\sqrt{5}\right)\left(\frac{3+\sqrt{5}}{2}\right)^n$. 
