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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | Yes | Non-negative integer k (k <= n) | |
| n | Yes | Non-negative integer n | |
| p | Yes | Prime modulus |