{
  "id": "least-common-multiple",
  "title": "Least Common Multiple",
  "lang": "en",
  "source_lang": "en",
  "summary": "The least common multiple of positive integers is the smallest positive integer divisible by each of them.",
  "category": "mathematics",
  "subcategory": "algebra",
  "type": "concept",
  "aliases": [
    "Lowest common multiple",
    "LCM",
    "lcm"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/least-common-multiple/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/least-common-multiple/",
      "json": "https://aiwiki.page/zh/least-common-multiple.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "The least common multiple of two or more positive integers is the smallest positive integer that is a multiple of every one of them. It is usually written \\(\\operatorname{lcm}(a,b)\\), or \\(\\operatorname{lcm}(a_1,\\ldots,a_n)\\) for several inputs. For example, \\(\\operatorname{lcm}(12,18)=36\\): both 12 and 18 divide 36, and no smaller positive integer has this property. A basic concept in arithmetic and number theory, the least common multiple is used to find common denominators, describe repeating cycles, and solve divisibility problems."
    },
    {
      "heading": "Definition and conventions",
      "text": "For positive integers \\(a_1,\\ldots,a_n\\), an integer \\(m\\) is a common multiple if each \\(a_i\\) divides \\(m\\). The notation \\(a_i\\mid m\\) means that \\(m=a_i k\\) for some integer \\(k\\).\n\nTheir least common multiple is therefore\n\n\\[\\operatorname{lcm}(a_1,\\ldots,a_n) = \\min\\{m>0:a_i\\mid m\\text{ for every }i\\}.\\]\n\nA positive common multiple always exists because the product \\(a_1\\cdots a_n\\) is one. The least common multiple has the stronger property that it divides every common multiple. Consequently, if \\(L=\\operatorname{lcm}(a_1,\\ldots,a_n)\\), the common multiples are exactly\n\n\\[\\ldots,-2L,-L,0,L,2L,\\ldots.\\]\n\nFor negative inputs, signs are ignored:\n\n\\[\\operatorname{lcm}(a,b)=\\operatorname{lcm}(|a|,|b|).\\]\n\nHere \\(|a|\\) denotes absolute value. A standard extension to zero is\n\n\\[\\operatorname{lcm}(a,0)=0,\\]\n\nincluding \\(\\operatorname{lcm}(0,0)=0\\). This is a convention extending the positive-input definition: there is no positive multiple of zero. It preserves the statement that an LCM is a common multiple dividing every common multiple."
    },
    {
      "heading": "Prime factorization",
      "text": "The fundamental theorem of arithmetic gives a direct way to construct an LCM. Write each positive input as a product of powers of prime numbers. For every prime appearing in any input, take the largest exponent with which it occurs.\n\nIf\n\n\\[a=\\prod_p p^{\\alpha_p}, \\qquad b=\\prod_p p^{\\beta_p},\\]\n\nwhere all but finitely many exponents are zero, then\n\n\\[\\operatorname{lcm}(a,b) = \\prod_p p^{\\max(\\alpha_p,\\beta_p)}.\\]\n\nFor example,\n\n\\[12=2^2\\cdot3, \\qquad 18=2\\cdot3^2,\\]\n\nso\n\n\\[\\operatorname{lcm}(12,18)=2^2\\cdot3^2=36.\\]\n\nThis also explains why the result divides every common multiple. Any common multiple must contain at least the prime-power factors required by every input, and hence must contain their maximum exponents.\n\nFor several positive integers, the same rule gives\n\n\\[\\operatorname{lcm}(a_1,\\ldots,a_n) = \\prod_p p^{\\max_i v_p(a_i)},\\]\n\nwhere \\(v_p(a_i)\\) is the exponent of \\(p\\) in the prime factorization of \\(a_i\\)."
    },
    {
      "heading": "Relationship with the greatest common divisor",
      "text": "The LCM is closely related to the greatest common divisor (GCD). For positive integers,\n\n\\[\\gcd(a,b)\\operatorname{lcm}(a,b)=ab.\\]\n\nThe GCD takes the minimum exponent of each prime, while the LCM takes the maximum. Since\n\n\\[\\min(\\alpha,\\beta)+\\max(\\alpha,\\beta)=\\alpha+\\beta,\\]\n\ntheir product contains exactly the prime factors of \\(ab\\).\n\nFor nonzero integers, this yields\n\n\\[\\operatorname{lcm}(a,b)=\\frac{|ab|}{\\gcd(a,b)}.\\]\n\nImportant special cases include:\n\n- If \\(a\\mid b\\) and both are positive, then \\(\\operatorname{lcm}(a,b)=b\\).\n- If \\(\\gcd(a,b)=1\\), then \\(\\operatorname{lcm}(a,b)=ab\\).\n- For positive \\(a,b\\),\n\n\\[\\max(a,b)\\leq\\operatorname{lcm}(a,b)\\leq ab.\\]\n\nIntegers with GCD 1 are called coprime. For several pairwise coprime positive integers, the LCM is their product. Merely having an overall GCD of 1 is not sufficient: 6, 10, and 15 have overall GCD 1, but their LCM is 30 rather than 900."
    },
    {
      "heading": "Computation",
      "text": "Listing multiples\n\nFor small numbers, the LCM can be found by listing successive positive multiples. For example:\n\n- Multiples of 6: \\(6,12,18,24,30,\\ldots\\)\n- Multiples of 8: \\(8,16,24,32,\\ldots\\)\n\nThe first shared value is 24. This method illustrates the definition but becomes inefficient when the first common multiple is large.\n\nUsing the Euclidean algorithm\n\nFor larger integers, an efficient algorithm first computes the GCD with the Euclidean algorithm, then uses\n\n\\[\\operatorname{lcm}(a,b) = \\left|\\left(\\frac{a}{\\gcd(a,b)}\\right)b\\right|.\\]\n\nThe division is exact. Dividing before multiplying reduces the size of the intermediate result and can avoid overflow when the final answer fits within the available integer range, although the LCM itself may still exceed that range. Zero inputs must be handled separately to avoid division by zero when both inputs are zero.\n\nFor example, \\(\\gcd(84,30)=6\\), so\n\n\\[\\operatorname{lcm}(84,30) = \\frac{84}{6}\\cdot30 = 420.\\]\n\nThis method does not require prime factorization.\n\nSeveral inputs\n\nThe LCM is associative:\n\n\\[\\operatorname{lcm}(a,b,c) = \\operatorname{lcm}(\\operatorname{lcm}(a,b),c).\\]\n\nIt can therefore be computed successively:\n\n\\[L_1=a_1, \\qquad L_k=\\operatorname{lcm}(L_{k-1},a_k).\\]\n\nFor instance,\n\n\\[\\operatorname{lcm}(8,12,18) = \\operatorname{lcm}(24,18) = 72.\\]\n\nThe two-input product formula does not extend simply by dividing the product of all inputs by their overall GCD."
    },
    {
      "heading": "Algebraic and order properties",
      "text": "For nonnegative integers, the LCM operation is commutative, associative, and idempotent:\n\n\\[\\operatorname{lcm}(a,b)=\\operatorname{lcm}(b,a), \\qquad \\operatorname{lcm}(a,a)=a.\\]\n\nIt also satisfies\n\n\\[\\operatorname{lcm}(a,1)=a, \\qquad \\operatorname{lcm}(a,0)=0,\\]\n\nand, for any integer \\(k\\),\n\n\\[\\operatorname{lcm}(ka,kb) = |k|\\operatorname{lcm}(a,b).\\]\n\nDivisibility defines a partial order on the positive integers: \\(a\\) precedes \\(b\\) when \\(a\\mid b\\). In this order, the LCM is the least upper bound, also called the join, while the GCD is the greatest lower bound, or meet. This order-theoretic description captures more than numerical minimality: every common multiple is divisible by the LCM."
    },
    {
      "heading": "Applications",
      "text": "Common denominators\n\nFor fractions with positive integer denominators, the LCM of the denominators is their least common denominator. For example,\n\n\\[\\frac{5}{12}+\\frac{7}{18} = \\frac{15}{36}+\\frac{14}{36} = \\frac{29}{36}.\\]\n\nThe product of the denominators is also a common denominator, but it may be unnecessarily large. Using the LCM keeps intermediate expressions smaller. It does not guarantee that the resulting fraction is already reduced.\n\nRepeating events\n\nIf two events occur together initially and then repeat at intervals of \\(a\\) and \\(b\\) units, with positive integer \\(a,b\\), their next simultaneous occurrence is after\n\n\\[\\operatorname{lcm}(a,b)\\]\n\nunits. Thus, events repeating every 12 and 18 minutes coincide again after 36 minutes.\n\nThe shared starting point matters. If the events begin at different times, their coincidence is instead a problem about congruences in modular arithmetic. For two integer periods, compatible starting offsets must differ by a multiple of the GCD of the periods. When a coincidence exists, all coincidence times form one congruence class modulo their LCM, as described by the generalized Chinese remainder theorem.\n\nPermutations\n\nIn group theory, a permutation decomposes into disjoint cycles. Its order—the smallest positive number of repetitions that returns every element to its original position—is the LCM of its cycle lengths. Disjoint cycles of lengths 4 and 6 therefore give a permutation of order 12."
    },
    {
      "heading": "Generalizations",
      "text": "For nonzero polynomials over a field, a least common multiple is defined by divisibility: it is divisible by every input and divides every common multiple. It is unique only up to multiplication by a nonzero constant; requiring it to be monic, with leading coefficient 1, makes it unique.\n\nThe integer construction also has an interpretation using ideals. If \\(a\\mathbb{Z}\\) denotes the set of all integer multiples of \\(a\\), then\n\n\\[a\\mathbb{Z}\\cap b\\mathbb{Z} = \\operatorname{lcm}(a,b)\\mathbb{Z}.\\]\n\nThus, intersecting the sets of multiples corresponds exactly to taking an LCM. In more general rings, such an intersection need not be generated by a single element, so least common multiples do not exist for every pair of elements."
    }
  ],
  "links": [
    "integer",
    "arithmetic",
    "number-theory",
    "absolute-value",
    "zero",
    "fundamental-theorem-of-arithmetic",
    "prime-number",
    "greatest-common-divisor",
    "algorithm",
    "euclidean-algorithm",
    "idempotence",
    "partial-order",
    "fraction",
    "modular-arithmetic",
    "chinese-remainder-theorem",
    "group-theory",
    "permutation",
    "polynomial",
    "field-mathematics",
    "ideal-ring-theory",
    "ring-mathematics"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}