The formula for the Josephus problem is:
J(n, k) = (J(n-1, k) + k-1) mod n + 1
where:
- J(n, k) represents the survivor position in a circle of n people, counting every kth person.
- n is the total number of people in the circle.
- k is the number of steps to be taken for each count.
what is the formula for the josephus problem
1 answer