1000 Samurai stand in a circle. They are labeled 1 through 1000. Samurai 1 is handed a sword, which he uses to kill Samurai 2 and hands the sword to Samurai 3, who kills Samurai 4 … and so on around the circle until only one Samurai remains. What is the number of the last Samurai left?
Solution is here