Skip to content

Stirling numbers at negative integers #17159

@PeterLuschny

Description

@PeterLuschny

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions