-
-
Notifications
You must be signed in to change notification settings - Fork 652
Description
Inconsistent behaviour of the Stirling numbers at negative integers
and insufficient documentation of these cases.
(1) stirling_number2(-3, -5) gives OverflowError.
(2) stirling_number2(-3, -5,"maxima") gives TypeError.
(3) stirling_number2(-3, -5, "gap") gives 35 which is correct but this
behaviour is not documented (doc says: n and k are nonnegative integers).
(4) stirling_number1(-3, -5) gives 25 which is correct but this
behaviour is not documented (doc implies that n and k are nonnegative integers).
Proposal: Make GAP’s Stirling2 the default (as is GAP’s Stirling1)
and document the behaviour for negative integers. (Perhaps disregard
'maxima' and the native implementation altogether?)
Remark: The behaviour of GAP's implementation is based on a simple and
coherent extension of the Stirling numbers to negative integers n, k
which was outlined by Graham/Knuth/Patashnik in 'Concrete Mathematics'
Section 6.1 (see Table 253).
Also, use libGAP not GAP, as was done in #16719.
Component: combinatorics
Keywords: Stirling numbers
Issue created by migration from https://trac.sagemath.org/ticket/17159