1000 students sit in a circle, numbered 1, 2, 3, ..., 1000. Now count 1 and 2: student No. 1 reports 1 and leaves immediately, student No. 2 reports 2 and stays, student No. 3 reports 1 and leaves immediately, student No. 4 reports 2 and stays... students report 1 alternately Or 2, all the students who reported 1 leave immediately, and the students who reported 2 stay, and so on until there is only one person left. Q: What is the student's number?
1000个学生坐成一圈，依次编号为1，2，3，…，1000．现在进行1，2报数：1号学生报1后立即离开，2号学生报2并留下，3号学生报1后立即离开，4号学生报2并留下…学生们依次交替报1或2，凡报1的学生立即离开，报2的学生留下，如此进行下去，直到最后还剩下一个人．问：这个学生的编号是几号？
<gadget id="calculator">2 ** 9</gadget>
<output>512</output>

<result>512</result>