A question one of my friend asked me:
There are $n$ (he told me to find for $100$ people and then asked the general formula for $n$ people) people sitting at a round table. A person (say $1$) killed $2$ and passed the gun to $3$. $3$ killed $4$ and passed the gun to $5$....
also, after reaching $99$ or so the cycle would again continue, someone will kill $1$ and pass the gun to $3$.
Who is the last one to remain alive?
Any help would be appreciated. :)
Also, I'm unable to find a proper tag for this question.
Determine the survivor by letting a program find the solution gives me this: $$n -> survivor \\ 3 -> 3\\ 4 -> 1\\ 5 -> 3\\ 6 -> 5\\ 7 -> 7\\ 8 -> 1\\ 9 -> 3\\ 10 -> 5\\ 11 -> 7\\ 12 -> 9\\ 13 -> 11\\ 14 -> 13\\ 15 -> 15\\ 16 -> 1\\ 17 -> 3\\ 18 -> 5\\ ... \\ 30 -> 29\\ 31 -> 31\\ 32 -> 1\\ 33 -> 3\\ ... \\ 62 -> 61\\ 63 -> 63\\ 64 -> 1\\ 65 -> 3\\ ... \\ 126 -> 125\\ 127 -> 127\\ 128 -> 1\\ 129 -> 3\\ ... \\ 254 -> 253\\ 255 -> 255\\ 256 -> 1\\ 257 -> 3\\ $$ and so on. If $n = 1$ gets the gun first. Oh and by $n=100$ it's $73$ who survives.