Add a solution to the Josephus problem.