two different approaches to solving Josephus problem