# Array integer LCM

`array-integer-lcm` · version 1.0.0 · Numbers & math · free, no key needed

Compute the non-negative least common multiple of an array of canonical integer strings.

**Use when you need to: array integer lcm · lcm of an array of integers · least common multiple of a list.**

## Supported

- array integer lcm
- lcm of an array of integers
- least common multiple of a list
- n-ary lcm

## Not supported

- greatest common divisor
- lcm of two integers
- floating-point lcm

## Behavior

- Input values is an array of canonical base-10 integer strings with at most 10000 items.
- The input -0 is accepted per item and canonicalized to 0 before evaluation.
- The empty array has lcm 1, the multiplicative identity.
- If any value is 0, the result is 0, matching the two-argument convention lcm(0, n) = 0.
- Otherwise the lcm is computed pairwise left to right as |a / gcd(a, b) * b| and is independent of order.
- The result is the non-negative least common multiple as a canonical integer string, at most 1000 digits.

## Input

- `values` (array of string, required): max items 10000; each max length 1001; each pattern `^-?(0|[1-9][0-9]*)$`

## Output

- `value` (string, required)

## Limits

- max items: 10000
- max digits: 1000

## Example

Request input:

```json
{
  "values": [
    "4",
    "6",
    "10"
  ]
}
```

Response:

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

## How to call it

### MCP

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

```json
{
  "id": "array-integer-lcm",
  "version": "1.0.0",
  "input": {
    "values": [
      "4",
      "6",
      "10"
    ]
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/array-integer-lcm/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"values":["4","6","10"]}'
```

The machine-readable contract is at [/v1/tools/array-integer-lcm/versions/1.0.0](/v1/tools/array-integer-lcm/versions/1.0.0).

### CLI

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

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

## Related tools

- [Array integer GCD](/tools/array-integer-gcd): Compute the non-negative greatest common divisor of an array of canonical integer strings.
- [Integer LCM](/tools/integer-lcm): Compute the non-negative least common multiple of two canonical integer strings.
- [Array integer median](/tools/array-integer-median): Select lower and upper middle canonical integers; emit median only for odd length.
- [Array rational sum](/tools/array-rational-sum): Sum an array of canonical rationals and return the reduced total.
- [Array integer min max](/tools/array-integer-min-max): Return the numeric minimum and maximum of canonical integer strings.
- [Array integer mode](/tools/array-integer-mode): Return the most frequent canonical integers, listing every mode in first-seen order.
