Opened 5 years ago

Last modified 5 years ago

## #17159 new defect

# Stirling numbers at negative integers

Reported by: | pluschny | Owned by: | |
---|---|---|---|

Priority: | minor | Milestone: | sage-6.4 |

Component: | combinatorics | Keywords: | Stirling numbers |

Cc: | Merged in: | ||

Authors: | Reviewers: | ||

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description (last modified by )

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.

**Note:**See TracTickets for help on using tickets.