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

  1. Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
  2. Enter values according to the field table, then run the tool.
  3. Read lcm. Preserve exact decimal strings and the stated indexing or coefficient order.
  4. Keep exact decimal strings for subsequent integer arithmetic; distinguish them from any explicitly approximate numeric result.
Input fieldMeaningValue type and boundsRequirement
valuesSigned decimal integerslist 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 fieldMeaningValue type
lcmLeast common multiplestring (integer/arbitrary)
json
{
  "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

  1. 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.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies