Which number remains alive? There are $100$ people standing in a circle numbered from $1$ to $100$. The first person is having a sword and kills the the person standing next to him clockwise i.e $1$ kills $2$ and so on. Which is the last number to remain alive? Also if $1$ kills both the person standing next to him. Which is the last number standing? Can both of them be generalized?

Here is the solution in Python : Not an elegant mathematical one ; but since I did not know the mathematically
from itertools import cycle
NUMBER = 100
people = list(range(1, NUMBER + 1))
dead = []
print  "Runing"

print people
people_list = cycle(people)

while len(people) != 1:
    tolive = next(people_list)
    if tolive not in dead:
        todel = next(people_list)

    if todel not in dead:
        dead.append(todel)
    else:
        people = set(people) - set(dead)
        print sorted(people)
        people_list = cycle(sorted(people))

print people
print "over"

For 100 it is 73
