On 21 Bře, 07:05, Craig Citro <craigci...@gmail.com> wrote: > > That works well, but what about when the expression is multivariate, > > such as: > > > expand((1+x+1/y)^10) > > > It would be nice to have a general command to count the number of > > summands in such an expression. > > Yep, I agree. Here is a *terrible* way to do it: > > sage: var('x,y') > (x, y) > sage: f = x+y + 1 > sage: len(expand(f._maxima_())) > 3 > sage: len(expand((f**4)._maxima_())) > 15 > I think that better way is to use maxima commands op, args, length, atomp
Robert Marik --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---