Josephus problem
The Josephus problem is a classic puzzle in mathematics and computer science, describing a scenario where people stand in a circle and are systematically eliminated by counting every -th person (with ) until only one survivor remains; the goal is to determine the initial position of that survivor, denoted as . This elimination process forms a permutation of the positions, and the problem has been generalized to various counting rules and moduli.