Problem

Source: China Girls Math Olympiad 2019 Day 1 P3

Tags: combinatorics



For a sequence, one can perform the following operation: select three adjacent terms $a,b,c,$ and change it into $b,c,a.$ Determine all the possible positive integers $n\geq 3,$ such that after finite number of operation, the sequence $1,2,\cdots, n$ can be changed into $n,n-1,\cdots,1$ finally.