# 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.**

## 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:

```json
{
  "n": 5
}
```

Response:

```json
{
  "result": {
    "value": "42"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "integer-catalan-number",
  "version": "1.0.0",
  "input": {
    "n": 5
  }
}
```

### HTTP (no key)

```sh
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](/v1/tools/integer-catalan-number/versions/1.0.0).

### CLI

```sh
node cli.mjs run integer-catalan-number 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Integer divisors](/tools/integer-divisors): List every positive divisor of a positive integer, ascending.
- [Integer is perfect square](/tools/integer-is-perfect-square): Test whether a non-negative integer string is a perfect square.
- [Integer is prime](/tools/integer-is-prime): Deterministically test whether a non-negative integer string is prime.
- [Integer nth root](/tools/integer-nth-root): Compute the exact floor of the nth root of a non-negative integer string.
- [Array integer adjacent diff](/tools/array-integer-adjacent-diff): Replace an array of canonical integer strings with consecutive first differences.
- [Array integer clamp](/tools/array-integer-clamp): Clamp an array of canonical integer strings to optional inclusive min and max bounds.
