StirlingS1
The signed Stirling number of the first kind, relating falling factorials to powers of n.
Stirling numbers of the first kindMathWorldStirlingNumberoftheFirstKindWikidataQ2657556DLMF26.8.i.p1FungrimStirlingS1Fungrim entry071a9418ec99OEISA008275Wolfram LanguageStirlingS1✓StirlingS1(n, k)the signed Stirling number of the first kind .Function[{n, k}, (-1)^(n - k) StirlingFirst[n, k], Listable][n, k]SageMathstirling_number1(n, k)!SymPystirling(n, k, kind=1, signed=True)mpmathstirling1(n, k)JuliaCombinatorics.stirlings1(big(n), k)Typed signatures
| Type | Package | Applies |
|---|---|---|
(integer, integer) -> integer | compute-engine | always |
(integer, integer) -> integer | number-theoryreplaces compute-engine | always |
Details
- Coefficients relating falling factorials to ordinary powers: .
- counts the permutations of n elements with exactly k cycles.
- and for , with the boundary case .
- The unsigned values in each row sum to :
- .
- Threads element-wise over a list of , as Wolfram's Listable heads do.
Plot
Examples
2 more kept as data, checked against the oraclesScope #
Properties #
No ways to arrange nothing into one cycle
live ↗Known value · Wolfram MathematicalFunctionData, StirlingS1
Zero cycles can't hold an element
live ↗Known value · Wolfram MathematicalFunctionData, StirlingS1
Zero cycles can't hold any element, for
live ↗Known value · Wolfram MathematicalFunctionData, StirlingS1
No arrangement into zero cycles
live ↗Known value · Wolfram MathematicalFunctionData, StirlingS1
Two 3-cycles, positive sign since is even
live ↗Known value · Wolfram MathematicalFunctionData, StirlingS1
Three permutations with one transposition, signed
live ↗Known value · Wolfram MathematicalFunctionData, StirlingS1
Six transpositions in , with sign
live ↗Known value · Wolfram MathematicalFunctionData, StirlingS1
About
| Examples | 34 |
|---|---|
| Checked against | Wolfram Language 34 agreeCombinatorica 32 agree2 differSageMath 21 agree8 differ1 unevaluated3 errorSymPy 29 agree1 unevaluated2 errormpmath 29 agree1 errormathlib4 19 agree7 differ4 errorJulia 20 agree7 differ1 unevaluated2 error |
| Crosswalk | WikipediaMathWorldWikidataDLMFFungrimFungrim entry ×2OEISWolfram LanguageCombinatoricaSageMathSymPympmathJulia |
Implementation
wolframpackages/oracle/src/mappings.tsSigned in Wolfram and compute-engine; Sage's stirling_number1, Combinatorics.jl's stirlings1 and Mathlib's Nat.stirlingFirst are UNSIGNED, so a sign difference here is expected, not a bug. Combinatorics.jl's stirlings1 also needs n as a BigInt past its Int64 lookup table (n > 20).
sagepackages/oracle/src/mappings.tsSigned in Wolfram and compute-engine; Sage's stirling_number1, Combinatorics.jl's stirlings1 and Mathlib's Nat.stirlingFirst are UNSIGNED, so a sign difference there is expected, not a bug. Combinatorics.jl's stirlings1 also needs n as a BigInt past its Int64 lookup table (n > 20).
juliapackages/oracle/src/mappings.tsSigned in Wolfram and compute-engine; Sage's stirling_number1, Combinatorics.jl's stirlings1 and Mathlib's Nat.stirlingFirst are UNSIGNED, so a sign difference here is expected, not a bug. Combinatorics.jl's stirlings1 also needs n as a BigInt past its Int64 lookup table (n > 20).
mathlib4packages/oracle/src/mappings.tsSigned in Wolfram and compute-engine; Sage's stirling_number1, Combinatorics.jl's stirlings1 and Mathlib's Nat.stirlingFirst are UNSIGNED, so a sign difference here is expected, not a bug. Combinatorics.jl's stirlings1 also needs n as a BigInt past its Int64 lookup table (n > 20).
combinatoricapackages/oracle/src/mappings.tsSigned in Wolfram and compute-engine; Combinatorica's StirlingFirst, like Sage's stirling_number1, is UNSIGNED, so the template carries the sign (-1)^(n-k). Combinatorics.jl's stirlings1 and Mathlib's Nat.stirlingFirst are UNSIGNED too, so a sign difference there is expected, not a bug. Combinatorics.jl's stirlings1 also needs n as a BigInt past its Int64 lookup table (n > 20).
sympypackages/oracle/src/mappings.tsSymPy's stirling defaults to the second kind and unsigned; kind=1, signed=True is the signed first kind, as ours and Wolfram's.
mpmathpackages/oracle/src/mappings.tsSigned, as ours.