On Jul 28, 2:21 am, kcrisman <kcris...@gmail.com> wrote: > On Jul 27, 1:17 am, Henryk Trappmann <bo198...@googlemail.com> wrote: > > sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n) > In fact, the answer appears to always be 1 or 0. Is that true?
Yes, its 1 for n>=j+1 and (of course) 0 for n<j+1 I discovered another small issue with the binomial: sage: binomial(0.5r,5) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /home/bo198214/projects/<ipython console> in <module>() /opt/sage-4.5-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/lib/ python2.6/site-packages/sage/rings/arith.pyc in binomial(x, m) 2887 if isinstance(x, (float, sage.rings.real_mpfr.RealNumber, 2888 sage.rings.real_mpfr.RealLiteral)): -> 2889 P = x.parent() 2890 if m < 0: 2891 return P(0) AttributeError: 'float' object has no attribute 'parent' -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org