
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
In the remote region of Torturie, the vizier places $n$ condemned prisoners in a circle, numbered sequentially from 1 to $n$. Relentlessly, he sends every second condemned prisoner to the executioner: prisoners $2, 4, \ldots$, and so on around the circle, skipping one person between executions, until only one prisoner remains.

Calculate, as a function of $n$, the number of the last remaining prisoner.

Present the answer in LaTex format: \boxed{Your answer}
user