Integer catalan number
integer-catalan-number · version 1.0.0 · Numbers & math · free, no key needed
Compute the nth Catalan number exactly.
Use when you need to: integer catalan number · nth catalan number · catalan sequence.
Decide before calling
Read the versioned contract and the supported scope below. Reuse integer-catalan-number@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use integer-catalan-number@1.0.0 for integer catalan number. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- integer catalan number
- nth catalan number
- catalan sequence
Not supported
- negative index
- binomial coefficient
- motzkin numbers
Behavior
- n is a JSON integer from 0 to 100000.
- C(0) is 1. The sequence is computed via the exact integer recurrence C(i+1) = C(i) * 2*(2i+1) / (i+2), each step an exact division, never floating point.
- Requests whose exact result would exceed 1000 digits are rejected rather than truncated.
Input
n(integer, required): min 0; max 100000
Output
value(string, required)
Limits
- max n: 100000
- max digits: 1000
Example
Request input:
{
"n": 5
}
Response:
{
"result": {
"value": "42"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "integer-catalan-number",
"version": "1.0.0",
"input": {
"n": 5
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/integer-catalan-number/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"n":5}'
The machine-readable contract is at /v1/tools/integer-catalan-number/versions/1.0.0.
CLI
node cli.mjs run integer-catalan-number 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Lucas number: Compute the Lucas number at a zero-based index and return its exact decimal string.
- Fibonacci number: Compute the Fibonacci number at a zero-based index and return its exact decimal string.
- Integer divisors: List every positive divisor of a positive integer, ascending.
- Integer is perfect square: Test whether a non-negative integer string is a perfect square.
- Integer is prime: Deterministically test whether a non-negative integer string is prime.
- Integer nth root: Compute the exact floor of the nth root of a non-negative integer string.