Problem

Source: Rio de Janeiro Mathematical Olympiad 2018, Level 3, #5

Tags: combinatorics



Let $n$ be an positive integer and $\sigma = (a_1, \dots, a_n)$ a permutation of $\{1, \dots, n\}$. The cadence number of $\sigma$ is the number of maximal decrescent blocks. For example, if $n = 6$ and $\sigma = (4, 2, 1, 5, 6, 3)$, then the cadence number of $\sigma$ is $3$, because $\sigma$ has $3$ maximal decrescent blocks: $(4, 2, 1)$, $(5)$ and $(6, 3)$. Note that $(4, 2)$ and $(2, 1)$ are decrescent, but not maximal, because they are already contained in $(4, 2, 1)$. Compute the sum of the cadence number of every permutation of $\{1, \dots, n\}$.