Josephus problem.