It is intriguing to me to consider now a cubic Diophantine with the approach of considering it modulo D-1.
Given x3 - Dy3 = 1 I'll try to find modular solutions for x and y modulo D-1:
x3 - Dy3 = 1 mod D-1, and D mod D-1 = 1, so:
x3 - y3 = 1 mod D-1
Which is: (x-y)(x2 + xy + y2) = 1 mod D-1, and letting r be any residue with an inverse modulo D-1:
x-y = r mod D-1 and x2 + xy + y2 = r-1 mod D-1, so, x = y+r mod D-1, allowing me to substitute:
(y+r)2 + (y+r)y + y2 = r-1 mod D-1
and expanding out gives:
y2 + 2yr + r2 + y2 + ry + y2 = r-1 mod D-1, so:
3y2 + 3yr + r2 - r-1 = 0 mod D-1, and I'll use fractions--though it can be done without them--to make things easier for me and complete the square:
y2 + yr +
r2 /4 -
r2 /4+( r2 - r-1 )/3 = 0 mod D-1, which is: (y+r/2)2 = -(r2 - 4r-1)/12 mod D-1, so:
3(2y+r)2 = 4r-1 - r2 mod D-1
And I think it is kind of ugly. But I'd think you could get answers with it, but just have to be able to find a quadratic residue, if it exists.
Just a curiosity. I'll put this up and maybe come back later to check my derivation and try it with some numbers.
I don't know of a practical use for this result, but it seemed like a fun thing to just extend a bit, and see what I got.