The Josephus Problem — Every k-th Person Eliminated

n people stand in a circle; counting k at a time, every k-th is eliminated until one survives. Watch the count walk the ring and the survivor emerge — then compare with the recurrence J(n) = (J(n-1) + k) mod n.

step 0

The circle (current count 0 / k)

alive eliminated counting pointer survivor

Status

remaining
7
eliminated
0
survivor
?

Elimination order

Press Step to begin. Counting starts at person 1; we move k people and eliminate whoever we land on, then resume from the next survivor.
Self-contained visualization. People are 1-indexed seats. The survivor matches the recurrence J(n) = (J(n-1) + k) mod n with J(1) = 0 (add 1 for the 1-indexed seat), and for k = 2 the closed form 2·(n − 2^⌊log₂ n⌋) + 1. See junior.md and professional.md.