Can anyone help me solve this Pell equation

elementary-number-theorypell-type-equations

I am trying to find the five smallest pairs of positive integers $p,q$ that satisfy the Pell's equation $p^2-321q^2 = 1$.

One obvious trivial solution is $p=1$ and $q=0$ , but this does not count. I am trying to find the five smallest pairs of positive integers $p,q$ that satisfy this equation. I would appreciate your help .

Best Answer

Method suitable for hand calculations.

As in the other answer, the larger solutions come from powers of the matrix $$ A = \left( \begin{array}{cc} 215 & 3852 \\ 12 & 215 \\ \end{array} \right) $$ The entries in $A^2, A^3, A^4, A^5$ become quite large; still, the main diagonals have two equal numbers, and the determinants remain $1.$

The letter $A$ stands for Automorphism, this matrix (notice that the determinant is $1\;$) is the generator of the (oriented) automorphism group of the quadratic form $x^2 - 321 y^2.$

Method described by Prof. Lubin at Continued fraction of $\sqrt{67} - 4$

$$ \sqrt { 321} = 17 + \frac{ \sqrt {321} - 17 }{ 1 } $$ $$ \frac{ 1 }{ \sqrt {321} - 17 } = \frac{ \sqrt {321} + 17 }{32 } = 1 + \frac{ \sqrt {321} - 15 }{32 } $$ $$ \frac{ 32 }{ \sqrt {321} - 15 } = \frac{ \sqrt {321} + 15 }{3 } = 10 + \frac{ \sqrt {321} - 15 }{3 } $$ $$ \frac{ 3 }{ \sqrt {321} - 15 } = \frac{ \sqrt {321} + 15 }{32 } = 1 + \frac{ \sqrt {321} - 17 }{32 } $$ $$ \frac{ 32 }{ \sqrt {321} - 17 } = \frac{ \sqrt {321} + 17 }{1 } = 34 + \frac{ \sqrt {321} - 17 }{1 } $$

Simple continued fraction tableau:
$$ \begin{array}{cccccccccccccc} & & 17 & & 1 & & 10 & & 1 & & 34 & \\ \\ \frac{ 0 }{ 1 } & \frac{ 1 }{ 0 } & & \frac{ 17 }{ 1 } & & \frac{ 18 }{ 1 } & & \frac{ 197 }{ 11 } & & \frac{ 215 }{ 12 } \\ \\ & 1 & & -32 & & 3 & & -32 & & 1 \end{array} $$

$$ \begin{array}{cccc} \frac{ 1 }{ 0 } & 1^2 - 321 \cdot 0^2 = 1 & \mbox{digit} & 17 \\ \frac{ 17 }{ 1 } & 17^2 - 321 \cdot 1^2 = -32 & \mbox{digit} & 1 \\ \frac{ 18 }{ 1 } & 18^2 - 321 \cdot 1^2 = 3 & \mbox{digit} & 10 \\ \frac{ 197 }{ 11 } & 197^2 - 321 \cdot 11^2 = -32 & \mbox{digit} & 1 \\ \frac{ 215 }{ 12 } & 215^2 - 321 \cdot 12^2 = 1 & \mbox{digit} & 34 \\ \end{array} $$