Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.