Josephus Problem: 100 Soldiers in a Circle Riddle

A popular riddle which you should attempt if you have never came across it. 100 Soldiers areĀ standing in a circle in an order 1 to 100. No.1 has a sword. He kills next person (i.e. no. 2) and gives sword to next to next (i.e no.3). All the soldiersĀ do the same until only 1 survives.