Example #1
0
 def _eval_rewrite_as_Product(self, n):
     if n.is_nonnegative and n.is_integer:
         i = Dummy('i', integer=True)
         return C.Product(i, (i, 1, n))
Example #2
0
 def _eval_rewrite_as_Product(self, n):
     if not (n.is_integer and n.is_nonnegative):
         return self
     k = Dummy('k', integer=True, positive=True)
     return C.Product((n + k) / k, (k, 2, n))