MathDB
Counting numbers and killing people

Source: 2022 China Southeast Grade11 P3

August 2, 2022
combinatorics

Problem Statement

There are nn people in line, counting 1,2,,n1,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)f(n) is the number of the last person left at the first count. Find the expression for f(n)f(n) and find the value of f(2022)f(2022)