If I have a solution $(x_0, y_0)$ to $x^2 - Dy^2 = k$ where D > 1 is not a square, how do I find another solution $(x_1,y_1)$ to $x^2 - Dy^2 = k$ without knowing the solution $(u,v)$ to $u^2 - Dv^2 = 1$ ?
I can find the first solution with Conway's topograph quite easily. However, the second solution shows up at the end of the period in the river of Conway's topograph (the river shows up in the topograph of indefinite binary quadratic forms).
I have read multiple answers to similar questions, but the prerequisite for solving the problem is to first find a fundamental solution to $x^2 - Dy^2 = 1$, which I do not have.
Edit 1: Forgot to mention that $D$ is too large to try computing the continued fraction. I tried this code implementing the algorithm for this, and it took a long time. Also, $k$ is not necessarily prime, I am looking for a general solution.
Here's what I have tried on my own:
I used this code to test out the chakravala method but it was slow.
- I have read Barbeau's book on the Pell Equation and started Buell's book.
- I read chapters 9-11 of An Illustrated Theory of Numbers.
- I read The Sensual (Quadratic) Form but only understood the chapters about the topograph.