There is a formula in wikipedia for the general case of josepus problem
But there is no reference for it, I don't know where it came from and I need too find out... Maybe Donald Knuth's Art of Programming?
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It only takes a minute to sign up.
Sign up to join this communityThere is a formula in wikipedia for the general case of josepus problem
But there is no reference for it, I don't know where it came from and I need too find out... Maybe Donald Knuth's Art of Programming?
In "Concrete Mathematics" by Graham, Knuth, Patashnik. Look in Chapter 3: Integer functions.