Counting off k takes k minus one moves
transcript
Five people stand in a circle. Count off three. The third is out. Who is left at the end?
The front is entrant one. Move one to the back. Move two to the back. Now three is at the front. Remove it.
Counting off k moves k minus one. The front is then the k-th. Remove it. The next round starts after.
A full lap changes nothing. So take the moves modulo the size. Four entrants and a count of six need one move.
Five entrants, count three. Out: three, one, five, two. Entrant four is left, so four wins the circle. Check it yourself with the sandbox.
Counting off is moving the front. Each move sends it to the back. No index arithmetic is needed. A circle is a queue.
Move k minus one from the front. The front is then out of the game. Full breakdown in the lecture.