I'm still not understanding what your program is trying to output. Based on the name of the function, I'm guessing that you want the "extended gcd", or some version of it. Type xgcd?? or XGCD?? for syntax. AFAIK, it only takes pairs, so you have to iterate it if you want a triple, like this for the extended gcd of 56,44,12:
sage: xgcd(56, 44) (4, 4, -5) sage: 4*56 + (-5)*44 4 sage: xgcd(gcd(56, 44), 12) (4, -2, 1) sage: ((-2)*4)*56 + ((-2)*(-5))*44 + (1)*12 4 Hope this helps. ++++++++++++++++++++++++++++++++++++++++++++++++++++ On Sat, Jul 19, 2008 at 9:45 AM, doctorantinfo <[EMAIL PROTECTED]> wrote: > > Ok, in input > x is the column of a matrix(list of integers), alpha is integer , and > i is also integer > for example > x= 2,5 > alpha =6 > i=1 > > On Jul 19, 3:31 pm, "John Cremona" <[EMAIL PROTECTED]> wrote: >> 2008/7/19 William Stein <[EMAIL PROTECTED]>: >> >> >> >> >> >> > On Sat, Jul 19, 2008 at 10:29 AM, doctorantinfo <[EMAIL PROTECTED]> wrote: >> >> >> Hello >> >> I wrote this program in SAGE online, but i failed to find error, I >> >> need help >> >> >> def gcd_multipliers(x, alpha, i): >> >> fac=factor(alpha) >> >> projections=[] >> >> for p,v in fac: >> >> l=[0]*len(x); >> >> if gcd(x[i],p)!= 1: l[i]=1; >> >> for j in range(1, len(x)): >> >> if gcd(x[j],p) == 1: >> >> l[j]=1; break >> >> projections.append(l) >> >> return CRT_vectors(projections, [p^v for p,v in fac]) >> >> >> Regards >> >> > In Python indentation is meaningful. So you have to post a program >> > here that is correctly indendented or it isn't meaningful. >> >> > -- William >> >> Also, if you want help debugging your program you should say what the >> program is trying do do: what is the input and what should be the >> output. Otherwise how can people help you? >> >> John >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
