lucas_theorem
Compute binomial coefficients C(n,k) modulo a prime with Lucas' theorem, enabling C(n,k) mod p calculations for large n and k.
Instructions
Compute binomial coefficient C(n,k) mod prime using Lucas' theorem.
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>",
"p": "<p>"
},
"name": "lucas_theorem"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | Yes | Non-negative integer k (k <= n) | |
| n | Yes | Non-negative integer n | |
| p | Yes | Prime modulus |