solving diophantine equations



Oddly enough, the user level of Maxima seems not to
have an implementation of the extended Euclidean algorithm.

(Macsyma has one: extgcd).

It takes about 6 lines of code to write it.
What makes it odd is that Maxima uses this code internally
in many places.  It has to be set up right, with a main variable,
which may make it tricky to do in some robust user-friendly way.

To change the line length to, say, 100,  type  linel:100$

RJF

Tuukka Toivonen wrote:
> 
> I need to use extended euclidean algorithm to solve some diophantine
> equations. I'd like to use free software for this, but unfortunately I
> can't find a corresponding routine in either Maxima or Pari/GP.
> 
> In maple there is the function gcdex, when given polynomials a(x) and
> b(x), it finds c and d such that
>         c*a(x) + d*b(x) = 1
> For example, if a(x)=x^16+1 and b(x)=x^16-1, then c=1/2 and d=-1/2 because
> 
>                               16        16
>                              x   + 1   x   - 1
>                              ------- - ------- = 1
>                                 2         2
> 
> Have I missed something, or can't Maxima (nor Pari!) really do this?
> 
> Another thing that bugs my slightly is that Maxima uses only 80 columns to
> display even if I'd have much more.
> 
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima