Ask Your Question
1

Finding coprime integer solutions

asked 2011-01-20 18:45:54 +0100

ASedarous gravatar image

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 flag offensive close merge delete

Comments

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!

kcrisman gravatar imagekcrisman ( 2011-01-24 11:31:38 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-12-15 07:31:06 +0100

John Cremona gravatar image

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)]
edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

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

Seen: 1,643 times

Last updated: Dec 15 '13