Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the number of permutations with a given number of ascents
ResourceFunction["EulerianNumber"][n,k] gives the number of permutations of {1,2,…,n} with k ascents. |
Count the number of ascents of the 24 permutations of {1,2,3,4}:
In[1]:= |
Out[1]= |
Tally up permutations by the number of ascents:
In[2]:= |
Out[2]= |
EulerianNumber gives the same list, calculated without implicitly listing the individual ascents:
In[3]:= |
Out[3]= |
The numbers form an infinite lower-triangular matrix:
In[4]:= |
Out[4]= |
The row sums are the factorials because they count the number of permutations:
In[5]:= |
Out[5]= |
In[6]:= |
Out[6]= |
Here the entries are signed in a checkerboard pattern:
In[7]:= |
Out[7]= |
Here are those row sums:
In[8]:= |
Out[8]= |
Expand Tan[x]:
In[9]:= |
Out[9]= |
Get rid of the factorials in the denominators to match the row sums up to signs and a shift:
In[10]:= |
Out[10]= |
This work is licensed under a Creative Commons Attribution 4.0 International License