Quant Memo
Brainteasers/●●●●

The Josephus problem

Asked at Jane Street, Citadel

nn people stand in a circle, numbered 11 to nn clockwise. Starting the count at person 11, every second person is eliminated (22 goes first, then 44, and so on), continuing around and around the shrinking circle until only one person remains.

For a given nn, which position survives? Work it out for n=100n = 100, and find the general rule.

Show a hint

Look for a pattern when nn is a power of 2. Then write n=2m+n = 2^m + \ell and see what the "extra" \ell people do to the answer.

Your answer

More Brainteasers questions