how to create circular linked list for the following situation?

If there is upto n number like

123456 initial list, start counting from 1

12456 no. 3 eliminated, continue counting from 4

1245 no. 6 eliminated, continue counting from 1

125 no. 4 eliminated, continue counting from 5

15 no. 2 eliminated, continue counting from 5

1 no. 5 eliminated, 1 is lucky

0