Problem

Source: 2022 China Southeast Grade11 P3

Tags: combinatorics



There are $n$ people in line, counting $1,2,\cdots, n$ from left to right, those who count odd numbers quit the line, the remaining people press 1,2 from right to left, and count off again, those who count odd numbers quit the line, and then the remaining people count off again from left to right$\cdots$ Keep doing that until only one person is in the line. $f(n)$ is the number of the last person left at the first count. Find the expression for $f(n)$ and find the value of $f(2022)$