Finding coprime integer solutions

I'm looking to find a way to find all coprime integer solutions to an equation. As an example, the equation xy + yz + z*x == 0, which I already know the answer to. Thanks!

edit retag close merge delete

Being a little more explicit about your question might help us help you. Are you looking for programming ideas? A command? What does "all coprime solutions" mean, precisely. Thanks!

( 2011-01-24 11:31:38 +0200 )edit

Sort by ยป oldest newest most voted

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)]

more

Please start posting anonymously - your entry will be published after you log in or create a new account.

Stats

Asked: 2011-01-20 18:45:54 +0200

Seen: 1,534 times

Last updated: Dec 15 '13