On Tue, Jul 20, 2010 at 4:26 PM, tvn <nguyenthanh...@gmail.com> wrote: > Is there a built in function that given n variables and d degree, > compute all the terms from degree 0 to d of all those n variables > combined ? The # of terms = bionomial(n+d,d)
Not built in exactly, but here is one way: sage: vars = (1,) + var('y, q, d, x, dd, r') sage: degree = 2 sage: [prod(vars[i] for i in indices) for indices in MultichooseNK(len(vars),degree)] [1, y, q, d, x, dd, r, y^2, q*y, d*y, x*y, dd*y, r*y, q^2, d*q, q*x, dd*q, q*r, d^2, d*x, d*dd, d*r, x^2, dd*x, r*x, dd^2, dd*r, r^2] --Mike -- 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 URL: http://www.sagemath.org