Flavius Josephus's sieve: Start with the natural numbers; at the $k$-th sieving step, remove every $(k+1)$-st term of the sequence remaining after the $(k-1)$-st sieving step; iterate.
Some examples: $$[1], (2), 3, (4), 5, (6), 7, (8), 9, (10), 11, (12), 13, (14), 15, (16), 17, (18), 19, (20)$$ $$[1], [3], (5), 7, 9, (11), 13, 15, (17), 19, 21, (23), 25, 27, (29), 31, 33, (35)$$ $$[1], [3], [7], (9), 13, 15, 19, (21), 25, 27, 31, (33), 37, 39, 43, (45)$$ $$[1], [3], [7], [13], (15), 19, 25, 27, 31, (37), 39, 43, 49, 51, (55)$$ $$[1], [3], [7], [13], [19], (25), 27, 31, 39, 43, 49, (51)$$ The resulting sequence $a(n)$ (A000960) begins $$1, 3, 7, 13, 19, 27, 39, 49, 63, 79, 91, 109, 133, 147, 181, 207, 223, 253, 289, 307, 349, 387, 399$$ There are at least $2$ ways to enumerate the number of the round in which $n$ is removed in the sieve of Flavius Josephus for $n = a(k)$:
Let $$b(n,m)=|b(n-1,m)-n-(b(n-1,m)\operatorname{mod} n)|, b(0,m)=m$$
I conjecture that if $q$ is the smallest number such that $b(q,n)=b(q,n-1)$, then
- if $b(q-1,n)-b(q-1,n-1)$ is positive, then it is the number of the round in which $n$ is removed in the sieve of Flavius Josephus
- if $b(q-1,n)-b(q-1,n-1)$ is negative, then $n = a(|b(q-1,n)-b(q-1,n-1)|)$
Is there a way to prove it?