MathOverflow will be down for maintenance for approximately 3 hours, starting Monday evening (06/24/2013) at approximately 9:00 PM Eastern time (UTC-4).
show/hide this revision's text 2 more references

Not quite an answer to the question but see http://en.wikipedia.org/wiki/Josephus_problem

There is a huge literature on the Josephus problem -- the wiki article is a good start. See also:

http://doc.utwente.nl/67513/1/pospp.pdf

and the very cool:

ftp://ftp.cis.upenn.edu/pub/wilf/josephus.ps

show/hide this revision's text 1

Not quite an answer to the question but see http://en.wikipedia.org/wiki/Josephus_problem