This program solves arbitrary instances of the Josephus problem.