Recently I've asked a question for how to solve Quadratic Diophantine Equation and I got one interesting answer. Link to question: The quadratic diophantine $ k^2 – 1 = 5(m^2 – 1)$
Here's the answer:
$$ x_n + y_n \sqrt{5} = \left(x_{n-1} + y_{n-1} \sqrt{5}\right)\left(\frac {3 + \sqrt{5}}{2}\right)^n$$
Actually it worked for my equation, which was: $x^2 – 5y^2 = -4$
I found the fundamental solution and it's $(x,y) = (1,1)$ and using the form from above i get:
$$ n = 1; (x,y) = (4,2)$$
$$ n = 2; (x,y) = (11,5)$$
$$ n = 4; (x,y) = (76,34)\ and\ so\ on$$
And indeed those pairs are solutions for my equation. (I excluded every non-integer numbers, because I'm only interested in integers)
But I'm experiencing problems with the following equation: $x^2 – 17y^2 = 13$
Fundamental solution is (9,2) and using the above form I get:
$$ n = 3; (x,y) = (121, 54)$$
And if I check this pair isn't solution to the equation. Where am I wrong?
Best Answer
The "topograph" for $x^2 - 13 y^2$ is definitely more complicated than the previous ones, because the continued fraction for $\sqrt {13}$ has period 5, your two previous examples had period 1. Confirming the "automorph" matrix, which just preserves the quadratic form:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The pairs of numbers in green are vectors in the plane. Two basic properties. First, each shows its value for $x^2 - 13 y^2.$ For example, in the first occurrence of 4, we see the (column) vector $(11,3),$ and we can easily confirm that $11^2 - 13 \cdot 3^2 = 4. $ Next, around any point where three purple line segments meet (even if two are parallel), one of the three green vectors is the sum of the other two. For example, $$ (4,1) + (7,2) = (11,3). $$ As long as we just continue to the right, we can continue getting all positive entries in green.
Oh: you said you can do continued fractions. It happens that you can find all representations of 4 and 1 using the continued fraction of $\sqrt {13},$ so you can confirm a good deal of the Conway diagram, the vectors in green, whatever.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=