Ask Your Question
0

Finding all integer solutions of binary quadratic form

asked 2024-02-20 16:53:10 +0200

imbluedabedee gravatar image

updated 2024-02-20 16:53:46 +0200

I found the following page to calculate one solution for a binary quadratic form $ax^2+bxy +cy^2$: Link

Is there an algorithm to find, if possible, all integer solutions?

edit retag flag offensive close merge delete

Comments

Here you might find some functions that might be of interest for you (and, among other things, also encapsulate pari's qfbsolve): BQForms

Peter Luschny gravatar imagePeter Luschny ( 2024-02-20 22:00:39 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2024-02-20 18:24:28 +0200

Max Alekseyev gravatar image

updated 2024-02-20 18:47:59 +0200

You can call pari.qfbsolve directly with flag set to 1 or 3. Rephrasing examples from the PARI/GP manual:

sage: pari.qfbsolve(pari.Qfb(1,0,2), 603, 1).sage()       # all primitive solutions
[[5, 17], [-19, -11], [19, -11], [5, -17]]

sage: pari.qfbsolve(pari.Qfb(1,0,2), 603, 3).sage()       # all solutions
[[5, 17], [-19, -11], [19, -11], [5, -17], [-21, 9], [-21, -9]]
edit flag offensive delete link more

Comments

Thanks a lot to you and Peter for your helpful comments!

imbluedabedee gravatar imageimbluedabedee ( 2024-02-22 17:37:09 +0200 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2024-02-20 16:53:10 +0200

Seen: 108 times

Last updated: Feb 20