josephus
Calculate the survivor’s position in a circle of n people where every k-th person is eliminated, solving the Josephus problem for given n and k.
Instructions
Solve the Josephus problem: find the survivor in a circle of n people eliminating every k-th.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"n": "<n>",
"k": "<k>"
},
"name": "josephus"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | Yes | Every k-th person is eliminated | |
| n | Yes | Number of people in the circle |