Least Common Multiple of a List
Compute the nonnegative least common multiple of 1–128 signed decimal integers using exact arithmetic; any zero entry makes the result zero.
Description
The least common multiple of integers is the smallest nonnegative common multiple under the tool’s zero convention.
The least common multiple of integers is the smallest nonnegative common multiple under the tool’s zero convention. Input signs do not affect it.1
The tool returns lcm. The indexing and output conventions below determine how to read these values.
When to use Least Common Multiple of a List
Use this for the following task: Compute the nonnegative least common multiple of 1–128 signed decimal integers using exact arithmetic; any zero entry makes the result zero. Use the input and output conventions below to reproduce the intended mathematical quantity.
How to use Least Common Multiple of a List and understand its results
- Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
- Enter values according to the field table, then run the tool.
- Read lcm. Preserve exact decimal strings and the stated indexing or coefficient order.
- Keep exact decimal strings for subsequent integer arithmetic; distinguish them from any explicitly approximate numeric result.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| values | Signed decimal integers | list of string (integer/arbitrary); minimum entries 1; maximum entries 128; each entry: maximum text length 200; pattern ^-?(0|[1-9][0-9]*)$ | Required |
Read 1–128 signed decimal strings with BigInt, take absolute values and combine values using gcd, dividing before multiplying.
lcm(a,b)=|a×b|/gcd(a,b), with lcm=0 if either input is zero The symbols and boundary conditions refer to the supplied fields and the implementation described above.
| Output field | Meaning | Value type |
|---|---|---|
| lcm | Least common multiple | string (integer/arbitrary) |
{
"input": {
"values": [
"12",
"-18",
"30"
]
},
"output": {
"lcm": "180"
}
} Limitations and assumptions
Any zero entry makes the result zero. Each integer string is at most 200 characters; the tool returns exact decimal text rather than a floating number.
Use the declared integer bounds and string formats. Large exact outputs remain decimal strings; numerical approximations use ordinary floating-point arithmetic. A rejected input is different from a valid zero count or false membership flag.
Alternative or Complementary methods
Choose Greatest Common Divisor of a List when you need its operation: Compute the nonnegative greatest common divisor of 1–1,000 signed decimal integers; an all-zero list has gcd zero. Choose Extended Euclidean Coefficients for the complementary operation: Find exact decimal coefficients x and y satisfying a·x+b·y=gcd(a,b), with a nonnegative gcd and deterministic coefficients even when both inputs are zero.
Background reference: The Euclidean Algorithm.
References
-
The Euclidean Algorithm — Wissam Raji, Mathematics LibreTexts
Similar or alternative tools
- Greatest Common Divisor of a List
Compute the nonnegative greatest common divisor of 1–1,000 signed decimal integers; an all-zero list has gcd zero.
- Extended Euclidean Coefficients
Find exact decimal coefficients x and y satisfying a·x+b·y=gcd(a,b), with a nonnegative gcd and deterministic coefficients even when both inputs are zero.