Problem

Source: 2022 IMOC C4

Tags: combinatorics, IMOC



Let $N$ be a given positive integer. Consider a permutation of $1,2,3,\cdots,N$, denoted as $p_1,p_2,\cdots,p_N$. For a section $p_l, p_{l+1},\cdots, p_r$, we call it "extreme" if $p_l$ and $p_r$ are the maximum and minimum value of that section. We say a permutation $p_1,p_2,\cdots,p_N$ is "super balanced" if there isn't an "extreme" section with a length at least $3$. For example, $1,4,2,3$ is "super balanced", but $3,1,2,4$ isn't. Please answer the following questions: 1. How many "super balanced" permutations are there? 2. For each integer $M\leq N$. How many "super balanced" permutations are there such that $p_1=M$? Proposed by ltf0501