First time here? Check out the FAQ!

Ask Your Question
1

Finding coprime integer solutions

asked 14 years ago

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!

Preview: (hide)

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 ( 14 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 11 years ago

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)]
Preview: (hide)
link

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: 14 years ago

Seen: 1,659 times

Last updated: Dec 15 '13