Skip to content

Eulerian ​

The Eulerian number A(n,k)A(n, k), the number of permutations of {1,…,n}\{1, …, n\} with exactly kk descents (equally, kk ascents).

Eulerian(n, k)the number of permutations of {1,…,n}\{1, …, n\} with exactly kk descents
CombinatoricaEulerian[n, k]SageMathenumeratio_eulerian(n, k)
Typed signatures
TypePackageApplies
(integer, integer) -> integercompute-enginealways

Domain: Combinatorics

Details
  • Counts from k=0k = 0: A(n,0)=1A(n, 0) = 1 is the identity, and A(n,k)=0A(n, k) = 0 for k≥nk \ge n (except A(0,0)=1A(0, 0) = 1). Combinatorica's Eulerian[n, k] has the same convention; the Function Repository's ResourceFunction["EulerianNumber"][n, k] counts kk from 11, so it equals Eulerian(n, k - 1). Wolfram 15 has no core Eulerian.
  • Satisfies A(n,k)=(k+1) A(n−1,k)+(n−k) A(n−1,k−1)A(n, k) = (k + 1)\,A(n - 1, k) + (n - k)\,A(n - 1, k - 1) and the symmetry A(n,k)=A(n,n−1−k)A(n, k) = A(n, n - 1 - k), which is why descents and ascents agree.
  • Equals Count(KDescentPermutations(n,k))Count(KDescentPermutations(n, k)), and the number of permutations pp with Descents(p)=kDescents(p) = k; compute-engine's native, exact in bigints.
  • A negative argument is left unevaluated (as is MahonianNumber); Combinatorica answers 00 for a negative kk.

Plot

Examples

2 more kept as data, checked against the oracles
Basic #

row 44: 1,11,11,11, 11, 11, 1

live ↗
InMap(k↦Eulerian(4,k),0..1..3)\mathrm{Map}(k↦\mathrm{Eulerian}(4, k), 0..1..3)Out[1,11,11,1]\bigl\lbrack1, 11, 11, 1\bigr\rbrack

Known value · OEIS A008292

row 55: 1,26,66,26,11, 26, 66, 26, 1

live ↗
InMap(k↦Eulerian(5,k),0..1..4)\mathrm{Map}(k↦\mathrm{Eulerian}(5, k), 0..1..4)Out[1,26,66,26,1]\bigl\lbrack1, 26, 66, 26, 1\bigr\rbrack

Known value · wolframscript 15.0.0, Combinatorica Eulerian[n, k]

the 1111 permutations of 44 with one descent

live ↗
InEulerian(4,1)\mathrm{Eulerian}(4, 1)Out1111

Known value · wolframscript 15.0.0, Combinatorica Eulerian[n, k]

the empty permutation has no descents

live ↗
InEulerian(0,0)\mathrm{Eulerian}(0, 0)Out11

Known value · wolframscript 15.0.0, Combinatorica Eulerian[n, k]

a permutation of 33 has at most 22 descents

live ↗
InEulerian(3,3)\mathrm{Eulerian}(3, 3)Out00

Known value · wolframscript 15.0.0, Combinatorica Eulerian[n, k]

A(6,2)=302A(6, 2) = 302 both ways

live ↗
InEulerian(6,2)=Count(KDescentPermutations(6,2))\mathrm{Eulerian}(6, 2)=\mathrm{Count}(\mathrm{KDescentPermutations}(6, 2))OutTrue\mathrm{True}
About
Examples8
Checked againstCombinatorica 7 agreeSageMath 5 agree
CrosswalkWikipediaMathWorldOEISCombinatoricaSageMath

Implementation

mappedcombinatoricapackages/oracle/src/mappings.ts
mappedsagepackages/oracle/src/mappings.ts

See also: Descents, Ascents, KDescentPermutations, MahonianNumber