(It is well-known that x2 - dy2 = -1 is soluble in positive integers, if and only if the length of the period of continued fraction of √d is odd.)
Sufficiency. Let (A,B,C) be a Pythagorean triple (ie. A2 + B2 = C2) with gcd(A, B) = 1.
Without loss of generality, we assume A is even, B odd.
Let aA - bB = ±1; d = a2 + b2. We see b is odd.
Then (x, y) = (aB + bA, C) satisfies x2 - dy2 = -1.
Proof. dy2 = (a2 + b2)(A2 + B2) = (aB + bA)2 + (aA - bB)2 = x2 + 1.
A = 2uv, B = u2 - v2, C = u2 + v2,
where (u,v) satisfies gcd(u,v) = 1, u > v > 0 and one of u and v is even.
We find the smallest (a,b) with a ≥ 0, b ≥ 0, and satisfying aA - bB = ±1.
(This satisfies a ≤ B/2, b ≤ A/2.)
We exhibit A, B, a, b, x and y.
We also print the fundamental solution η = (X, Y) of x2 - dy2 = -1 and the relation (x,y) = ηn.
See online paper.
Last modified 5th December 2013
Return to main page