MathDB
Permutations problem

Source: Russian TST 2019, Day 4 P2

March 22, 2023
combinatoricspermutations

Problem Statement

For each permutation σ\sigma of the set {1,2,,N}\{1, 2, \ldots , N\} we define its correctness as the number of triples 1i<j<kN1 \leqslant i < j < k \leqslant N such that the number σ(j)\sigma(j) lies between the numbers σ(i)\sigma(i) and σ(k)\sigma(k). Find the difference between the number of permutations with even correctness and the number of permutations with odd correctness if a) N=2018N = 2018 and b) N=2019N = 2019.