Problem

Source: KJMO 2022 number 2

Tags: combinatorics, counting



For positive integer $n \ge 3$, find the number of ordered pairs $(a_1, a_2, ... , a_n)$ of integers that satisfy the following two conditions For positive integer $i$ such that $1\le i \le n$, $1 \le a_i \le i$ For positive integers $i,j,k$ such that $1\le i < j < k \le n$, if $a_i = a_j$ then $a_j \ge a_k$