In a circle of $n$ objects, numbered 1 to $n$, every $m^{\text{th}}$ object is eliminated from the circle until only one object remains. What is the number of that object that remains?
### Solution
Let $J(n,m)$ give the expression for the remaining object's number.
The associated sequence of eliminations and survivor be $E(n,m)=\langle m ,\ldots, J(n,m)\rangle$
In the case of $m=1$,
$E(n,1)= \langle 1,2,3,\ldots n\rangle \implies J(n,1)=n$
Exploring cases where $m=2$
$E(2,2)= \langle 2,1 \rangle \implies J(2,2)=1$
$E(3,2)= \langle 2,1,3\rangle \implies J(3,2)=3$
$E(4,2)= \langle 2,4,3,1\rangle \implies J(4,2)=1$
$E(5,2)= \langle 2,4,1,5,3\rangle \implies J(5,2)=3$
$E(6,2)= \langle 2,4,6,3,1,5\rangle \implies J(4,2)=5$
$E(7,2)= \langle 2,4,6,1,5,3,7\rangle \implies J(4,2)=7$
$E(8,2)= \langle 2,4,6,8,3,7,5,1\rangle \implies J(4,2)=1$
It seems likely from this that expressing $n$ as $2^k+r$ where $0\leq r<2^k$ leads to $\boxed{J(2^k+r,2)=1+2r}$
~~Meaning, hopefully generally, $n$ as $m^k+r$ where $0\leq r<m^k$ leads to $J(m^k+r,2)=1+mr$
To find $k$, take $\lfloor\log_mn\rfloor$~~
But when looking this up, apparently that is *incorrect*. The general case is not nearly as trivial as I thought it was. But for $m=2$, it seems I have the **right answer**.