Pseudocode for my solution:
i = 0
while there are elves still remaining:
elf i removes elf j from the circle (this is where the formula comes in to calculate j based on i)
i++ (well, goes to the next elf left in the circle)