people in the circle
by Pomegranat, May 12, 2025, 3:03 AM
Let
people be arranged in a circle, numbered clockwise from
to
. These people are eliminated one by one in order, until only one person remains. The elimination follows this rule: among the remaining people, start counting clockwise from the person with the smallest number, and eliminate the
-th person in that count. Then, among the remaining people, start counting again from the person with the smallest number and eliminate the
-th person. Repeat this process until only one person remains. Let
denote the number of the last remaining person.
For example, when
, people are eliminated in the following order:
. Thus,
. It is known that
under certain conditions. Prove that the necessary and sufficient condition for this is that both
and
are prime numbers.






For example, when





