← RoseCode

ROSECODE 167

Circle Festival

elasolova · Math ·

A huge crowd is celebrating the new season.
There are N people(numbered from 1 to N) in the crowd and they gather in a circle in sequence.
They decide to play a game like this:
It starts with 1st person. He eliminates person 2 with a wooden sword and gives the sword to 3. Then 3 eliminates 4 and sword is passed to 5. So each person eliminates the one next to himself and passes the sword to the other next. The winner of the game is the last person standing.


Which number is the winner if N=9*10^29?
Hint: Deduce a formula from smaller cases