| 1 | int J(int n, int k) { |
| 2 | if (n == 1) return 0; |
| 3 | if (k == 1) return n-1; |
| 4 | if (n < k) return (J(n-1,k)+k)%n; |
| 5 | int np = n - n/k; |
| 6 | return k*((J(np,k)+np-n%k%np)%np) / (k-1); } |
| 7 | // vim: cc=60 ts=2 sts=2 sw=2: |
nothing calls this directly
no outgoing calls
no test coverage detected