A simple and coherent extension of the binomial function
to negative integers n, k was outlined by M. J. Kronenburg in
The Binomial Coefficient for Negative Arguments,
http://arxiv.org/abs/1105.3689
This extension amounts to define
def BINOMIAL(n, k):
if n >= 0 and k >= 0:
return binomial(n, k)
if k >= 0:
return (-1)^k*binomial(-n+k-1, k)
if k <= n:
return (-1)^(n-k)*binomial(-k-1, n-k)
return 0
(Here BINOMIAL is the extended version, binomial the
implemented version.)
The benefit, among other things, is: Accordance with the
behaviour of Maple and Mathematica.
Peter
(Thanks to John Palmieri for the reference.)
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.