Tim Lahey wrote: > Hi, > > Does the Factorization class not have a > routine to return just a list of the factors? > Basically, something like the value function > but instead of multiplying them, puts > each term into a list? > > I ask because the output of a squarefree_decomposition > is a factorization and I'd like to use those factors > in a partial fraction expansion. > > I suppose I could do, > l = [] > j = 0 > while (j <= len(c)): > l.append((c[j][0])**(c[j][1])) > j = j + 1 > > if c is the factorization object, but I would think that > something like that would be part of the class.
An easier way: sage: f=factor(16200) sage: f 2^3 * 3^4 * 5^2 sage: [i^j for i,j in f] [8, 81, 25] Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---