combinatorics_operation
Compute binomial coefficients, permutations, combinations, integer partitions, factorials, and Catalan, Fibonacci, or Bell numbers for a given integer n.
Instructions
Combinatorics: binomial coefficients, permutations, combinations, integer partitions, factorial, Catalan, Fibonacci and Bell numbers. Prefer this over evaluate_sage for any of these.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | Secondary argument (for binomial, combinations). Decimal strings accepted, as for n. | |
| n | Yes | Primary integer argument. Values at or above 2^53 must be passed as a decimal string, e.g. "9007199254740993", because a JSON number that large has already been rounded by the client. | |
| session | No | Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the same workspace across reconnects and is a bearer credential -- keep it secret. Omit for 'default'. | default |
| operation | Yes | One of: binomial (n choose k), permutations (n!), combinations (n choose k), partitions (COUNT of integer partitions of n), factorial (n!), catalan (nth Catalan number), fibonacci (nth Fibonacci number), bell (nth Bell number). All return a single integer. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||