Suppose there are 'n' soldiers standing in a circle who have decided to kill each other (just because they don't want to surrender to the opposition).
Lets say they are denoted from a1 to an in the clockwise direction and the first soldier (a1) kills the mth living soldier (i.e. the dead soldiers will not be included in the counting) next to him (am+1) in the clockwise direction. After killing the soldier, the soldier standing next to the dead soldier (in CW direction) kills the mth soldier next to him.
So the pattern of killing goes like this:
a1 kills am+1
am+2 kills a2m+2
a2m+3 kills a3m+3
and so on.
(But this analogy is valid only for one circle, since after that the relative positions will be different with respect to their their denotations)
Is it possible to devise out a general formula for the last standing soldier? If yes, how can I approach this question?
This is a broader version of the Josephus problem. In Josephus problem where m=2.
What I tried:
I tried for a hit and trial method keeping 'n' constant with varying 'm' but could not observe any specific pattern.
Thanks :)