| 1 | initial version |
Since your equation is homogeneous in 3 variables it defines a projective curve, and it is possible to search for points on it like this:
sage: P2Q.<x,y,z> = ProjectiveSpace(QQ,2)
sage: f = x*y+y*z+z*x
sage: C = Curve(f)
sage: C
Projective Conic Curve over Rational Field defined by x*y + x*z + y*z
sage: C.rational_points(bound=10)
[(-3 : -3/2 : 1),
(-2 : -2 : 1),
(-3/2 : -3 : 1),
(-2/3 : 2 : 1),
(-1/2 : 1 : 1),
(-1/3 : 1/2 : 1),
(0 : 0 : 1),
(0 : 1 : 0),
(1/2 : -1/3 : 1),
(1 : -1/2 : 1),
(1 : 0 : 0),
(2 : -2/3 : 1)]
Note that the current implementation of point-finding on plane curves over QQ is very naive, but a better implementation is currently under development.
Secondly, the solutions are presented in projective coordinates normalised so that the last nonzero coordinate is 1. To get coprime integer solutions just scale up.
sage: Pts = C.rational_points(bound=10)
sage: [P.clear_denominators() for P in Pts]
[None, None, None, None, None, None, None, None, None, None, None, None]
sage: Pts
[(-6 : -3 : 2),
(-2 : -2 : 1),
(-3 : -6 : 2),
(-2 : 6 : 3),
(-1 : 2 : 2),
(-2 : 3 : 6),
(0 : 0 : 1),
(0 : 1 : 0),
(3 : -2 : 6),
(2 : -1 : 2),
(1 : 0 : 0),
(6 : -2 : 3)]
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.