Implement the josephus problem using recession.