1. ## Another Counting Problem...

If Larry were condemned to die, he is put on Death Row until the last day of the year. Then all prisoners from Death Row are arranged in a circle and numbered 1, 2, 3, 4, ..., n. Starting with #2 every second one is shot until one remains who is immediately set free. How should Larry choose, if he can, the place number of the sole survivor?

2. Originally Posted by MATNTRNG
If Larry were condemned to die, he is put on Death Row until the last day of the year. Then all prisoners from Death Row are arranged in a circle and numbered 1, 2, 3, 4, ..., n. Starting with #2 every second one is shot until one remains who is immediately set free. How should Larry choose, if he can, the place number of the sole survivor?
One of the more colorful/morbid problems I've seen, haha.

From a thoughtlessness point of view, it is not hard to use a computer simulation to find out the location of the sole survivor for a given n, until n gets to around 10^8 depending on the computer. Obviously since the algorithm is deterministic there is always a unique sole survivor.

I somewhat cheated. If we consider starting on #1 instead of #2 (which is how we might expect the problem to be stated in "standard form"), then it is easy to work out on paper the start of the sequence, and using OEIS quickly reveals A152423. This should be more than enough of a head start for you.