I'd been searching the internet for hours and finally I've found and understood the solution of Pell's equation of the form x² - D·y² = 1.
However, I got stuck for the solution of x² - D·y² = c, where D = 20 and c = 80·k, k being any integer other than zero.
For the equation x² - 20·y² = 1, starting with [x0, y0, k0] = [5, 1, 5],
(5)² - 20·(1)² = 5
and using Bhaskara's cyclic method (derived from Brahmagupta's identity),
[x1, y1, k1] = [(m·x0 + D·y0) / k, (x0 + m·y0) / k, (m² - D) / k]
choosing m = 5 leads to the first solution as [x1, y1] = [9, 2]
composing [x1, y1] with itself leads to the second solution
[x2, y2] = [161, 36]
further composing [x1, y1] with [x2, y2] leads to the third solution
[x3, y3] = [2889, 646]
So far, so good...
Where I fail to understand is, how do I jump from the solution x² - 20·y² = 1 into x² - 20·y² = 80 or x² - 20·y² = 160 (x² - 20·y² = 80·k in general).
Can anybody explain in short? Any helpful internet link would be sufficient and would be appreciated as well.