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

  1. Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
  2. Enter n, k according to the field table, then run the tool.
  3. Read value. Preserve exact decimal strings and the stated indexing or coefficient order.
  4. Keep exact decimal strings for subsequent integer arithmetic; distinguish them from any explicitly approximate numeric result.
Input fieldMeaningValue type and boundsRequirement
nPermutation size (resource limit 300)integer; minimum 0; maximum 300Required
kCycle count (resource limit 300)integer; minimum 0; maximum 300Required

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 fieldMeaningValue type
valueSigned Stirling number of the first kindstring (integer/arbitrary)
json
{
  "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

  1. 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.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies