37 soldiers stood in a circle. Every k-th person was eliminated. Josephus figured out where to stand to be last. Set n and k, then watch the elimination unfold.
Status: Ready
Next to eliminate: —
Survivor: —
J(n,k) formula: position = f(n,k) by recurrence
History: Flavius Josephus (37–100 CE) was a Jewish historian who claimed he and a companion survived a mass suicide pact
by working out the safe position. The recurrence is J(1,k)=1, J(n,k)=(J(n−1,k)+k−1) mod n + 1.
For k=2 there's a beautiful closed form: if n=2^m + L then J(n)=2L+1.