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.
Why do you want to find more integral solutions without ever using information about integral solutions to the equation $x^2 - Dy^2 = 1$?
The main structure theorem about integral solutions to $x^2 - Dy^2 = k$ is threefold:
(i) when $(x_0,y_0)$ is an integral solution to $x^2 - Dy^2 = k$, so are the coefficients of $(x_0 + y_0\sqrt{D})(a+b\sqrt{D})$ where $(a,b)$ is an arbitrary solution to $x^2 - Dy^2 = 1$,
(ii) there are finitely many integral solutions $(x_0,y_0),\ldots,(x_m,y_m)$ to $x^2 - Dy^2 = k$ such that every other integral solution to this equation occurs as coefficients of $(x_i+y_i\sqrt{D})(a+b\sqrt{D})$ for some $i = 1,\ldots,m$ and $a^2 - Db^2 = 1$,
(iii) in terms of one $(a,b)$ where $a^2 - Db^2 = 1$ and $a, b \geq 1$, you can find the finitely many solutions $(x_i,y_i)$ for (ii) in an explicit box in the plane.
See Theorem 3.3 and Corollary 3.5 here. Section 4 there has several worked examples.
You say in your answer that "$D$ is too large to try computing the continued fraction" of $\sqrt{D}$. What kind of $D$ are you using? If you find enough integral solutions to $x^2 - Dy^2 = k$, then taking a suitable ratio $(x+y\sqrt{D})/(x'+y'\sqrt{D})$ for some of them is going to give you a solution to $x^2 - Dy^2 = 1$, so bypassing the direct use of solutions to the Pell equation in solving he generalized Pell equation is going to amount to solving the Pell equation by another method. So maybe you should look at a survey paper on ways to solve Pell equations, like Lenstra's AMS Notices article https://www.ams.org/notices/200202/fea-lenstra.pdf.