-
-
Notifications
You must be signed in to change notification settings - Fork 654
Closed
Description
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
(Thanks to John Palmieri for the reference.)
This extension amounts to define
def BINOMIAL(n, k):
if n in ZZ and k in ZZ:
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
else:
return binomial(n, k)
Here 'BINOMIAL' is the targeted version, 'binomial' the
implemented version. The targeted behaviour is identical
to the behaviour of the Maple and Mathematica function
for negative integers n, k.
CC: @rwst
Component: combinatorics
Keywords: binomial
Branch/Commit: u/chapoton/17123 @ 0c99437
Issue created by migration from https://trac.sagemath.org/ticket/17123