Integer solutions to linear equation?

Chad Netzer cnetzer at
Thu Apr 20 16:11:11 EDT 2000

Grant Edwards wrote:

> Is there a non-iterative way to
> solve a linear equation when the results are contrained to be
> integers?  I don't remember anything from any of my math
> classes that seems relevent, but I didn't take any anything
> beyond what is required for all undergrad engineers.

Besides the Euclid method described by others, you could also look into Groebner
Bases, which are a kind of generalization of Euclid's method (along with
Gaussian Elimination and Linear Programming).  I'm no expert, but here is a link
to a Grobner Bases info page,to get you started.  I doubt there is anything
written for Python, although there are good algorithms for computing these bases
that COULD be done in Python.  But there are other algebra systems that already
do it (including Mathematica and Maple).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list