Integer LCM
integer-lcm · version 1.0.0 · Numbers & math · free, no key needed
Compute the non-negative least common multiple of two canonical integer strings.
Use when you need to: integer lcm · least common multiple of two integers · lcm of integers.
Supported
- integer lcm
- least common multiple of two integers
- lcm of integers
Not supported
- greatest common divisor
- lcm of more than two integers
- floating-point lcm
Behavior
- Inputs are canonical integer strings: 0 or an optional ASCII minus followed by a non-zero leading digit.
- The input -0 is accepted and canonicalized to 0 before evaluation.
- lcm(a, b) = |a / gcd(a, b) * b|, using the convention lcm(0, n) = lcm(n, 0) = 0 for every n, including lcm(0, 0) = 0.
- Each input may have at most 1000 digits excluding the sign.
- The result is the non-negative least common multiple as a canonical integer string, at most 1000 digits.
Input
a(string, required): min length 1; max length 1001b(string, required): min length 1; max length 1001
Output
value(string, required): min length 1; max length 1000
Limits
- max digits: 1000
Example
Request input:
{
"a": "4",
"b": "6"
}
Response:
{
"result": {
"value": "12"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "integer-lcm",
"version": "1.0.0",
"input": {
"a": "4",
"b": "6"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/integer-lcm/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"a":"4","b":"6"}'
The machine-readable contract is at /v1/tools/integer-lcm/versions/1.0.0.
CLI
node cli.mjs run integer-lcm 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Array integer LCM: Compute the non-negative least common multiple of an array of canonical integer strings.
- Integer GCD: Compute the non-negative greatest common divisor of two canonical integer strings.
- Array integer GCD: Compute the non-negative greatest common divisor of an array of canonical integer strings.
- Array integer min max: Return the numeric minimum and maximum of canonical integer strings.
- Array integer mode: Return the most frequent canonical integers, listing every mode in first-seen order.
- Array integer ranks: Assign competition (1224) ranks to canonical integers; ties share the minimum rank.