Signed Stirling Number of the First Kind
Return s(n,k), the cycle-count Stirling number multiplied by (−1)^(n−k), exactly as a decimal integer, with s(0,0)=1 and indices capped at 300.
Description
Signed Stirling numbers of the first kind attach a sign to counts of permutations with a fixed number of cycles.
Signed Stirling numbers of the first kind attach a sign to counts of permutations with a fixed number of cycles. The sign is (−1)^(n−k), so the result can be negative.1
The tool returns value. The indexing and output conventions below determine how to read these values.
When to use Signed Stirling Number of the First Kind
Use this for the following task: Return s(n,k), the cycle-count Stirling number multiplied by (−1)^(n−k), exactly as a decimal integer, with s(0,0)=1 and indices capped at 300. Use the input and output conventions below to reproduce the intended mathematical quantity.
How to use Signed Stirling Number of the First Kind and understand its results
- Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
- Enter n, k according to the field table, then run the tool.
- Read value. Preserve exact decimal strings and the stated indexing or coefficient order.
- Keep exact decimal strings for subsequent integer arithmetic; distinguish them from any explicitly approximate numeric result.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| n | Permutation size (resource limit 300) | integer; minimum 0; maximum 300 | Required |
| k | Cycle count (resource limit 300) | integer; minimum 0; maximum 300 | Required |
Use descending one-row BigInt updates and return the exact signed decimal value. A cycle count above n returns zero.
s(n,k)=s(n−1,k−1)−(n−1)×s(n−1,k); s(0,0)=1 The symbols and boundary conditions refer to the supplied fields and the implementation described above.
| Output field | Meaning | Value type |
|---|---|---|
| value | Signed Stirling number of the first kind | string (integer/arbitrary) |
{
"input": {
"n": 5,
"k": 2
},
"output": {
"value": "-50"
}
} Limitations and assumptions
This uses the signed convention rather than the unsigned cycle count. Both indexes are capped at 300 and no permutations are enumerated.
Use the declared integer bounds and string formats. Large exact outputs remain decimal strings; numerical approximations use ordinary floating-point arithmetic. A rejected input is different from a valid zero count or false membership flag.
Alternative or Complementary methods
Choose Stirling Number of the Second Kind when you need its operation: Count partitions of n labeled elements into k nonempty unlabeled blocks exactly, returning zero when k exceeds n; indices are capped at 300. Choose Involution Number for the complementary operation: Count permutations of n labeled elements consisting only of fixed points and transpositions exactly, including the empty involution; n is capped at 2,000.
Background reference: Digital Library of Mathematical Functions, §26.8.
References
-
Digital Library of Mathematical Functions, §26.8 — National Institute of Standards and Technology
Similar or alternative tools
- Stirling Number of the Second Kind
Count partitions of n labeled elements into k nonempty unlabeled blocks exactly, returning zero when k exceeds n; indices are capped at 300.
- Involution Number
Count permutations of n labeled elements consisting only of fixed points and transpositions exactly, including the empty involution; n is capped at 2,000.