Josephus Problems:
There are people standing in a circle waiting to be executed. After the first person is executed, a certain number of people are skipped and one person is executed. Then, again, people are skipped and a person is executed. The elimination proceeds around the circle (which is becoming smaller and smaller as the executed people are removed), until only the last person remains, who is given freedom.
let n means the number of people in the cycle, k means when the people count k, then he/she is executed.
Solutions: when k = 2
We explicitly solve the problem when every 2nd person will be killed, i.e. k = 2. (For the more general case , we outline a solution below.) We expres