Eulerian Number

Count permutations of n labeled elements with exactly k ascents, using A(0,0)=1 and zero outside the counting range; indices are capped at 300.

Description

Eulerian numbers count permutations by their number of ascents.

Eulerian numbers count permutations by their number of ascents. An ascent is a position where the next element is larger, giving at most n−1 ascents for a nonempty permutation.1

The tool returns value. The indexing and output conventions below determine how to read these values.

When to use Eulerian Number

Use this for the following task: Count permutations of n labeled elements with exactly k ascents, using A(0,0)=1 and zero outside the counting range; indices are capped at 300. Use the input and output conventions below to reproduce the intended mathematical quantity.

How to use Eulerian Number 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
kAscent count (resource limit 300)integer; minimum 0; maximum 300Required

Handle the empty case as A(0,0)=1 and return zero for impossible ascent counts. Use descending one-row BigInt updates for the recurrence.

A(n,k)=(n−k)A(n−1,k−1)+(k+1)A(n−1,k)

The symbols and boundary conditions refer to the supplied fields and the implementation described above.

Output fieldMeaningValue type
valueEulerian numberstring (integer/arbitrary)
json
{
  "input": {
    "n": 4,
    "k": 1
  },
  "output": {
    "value": "11"
  }
}

Limitations and assumptions

Both indexes are at most 300. The count concerns ascents, not cycles or set partitions, 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 Signed Stirling Number of the First Kind when you need its operation: 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. 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.14.

References

  1. Digital Library of Mathematical Functions, §26.14 — National Institute of Standards and Technology

Similar or alternative tools

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

  • 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