Number Theory
    20 min read
    August 2026

    GCD and LCM: the Fundamental Relationship and Its Generalization to N Numbers

    From the classic relationship between Greatest Common Divisor and Least Common Multiple of two numbers to its surprising generalization to a set of N natural numbers, through canonical factorization.

    4. Observations and Special Cases

    Counterexample 1 (Why naively generalizing doesn't work)

    A natural, but wrong, attempt would be to replace the GCD of the co-products in Theorem 2's formula with the GCD of the ai themselves, i.e. to conjecture∏i=1Nai=?LCM(a1,…,aN)⋅GCD(a1,…,aN).\displaystyle \prod_{i=1}^{N} a_i \overset{?}{=} LCM(a_1,\dots,a_N)\cdot GCD(a_1,\dots,a_N).This formula is false in general for N≥3. A concrete example: a₁=4, a₂=6, a₃=9. We have LCM(4,6,9)=36 and GCD(4,6,9)=1 (no prime factor is common to all three), so LCM·GCD=36, while

    ∏i=13ai=4⋅6⋅9=216 ≠ 36.\prod_{i=1}^{3} a_i = 4\cdot 6\cdot 9 = 216 \ \ne\ 36.

    The naive formula fails badly. Let's check instead that the correct formula from Theorem 2 works: the co-products are 216/4=54, 216/6=36, 216/9=24; GCD(54,36,24)=6; and indeed

    LCM(4,6,9)⋅GCD(54,36,24)=36⋅6=216=∏i=13ai. ✓LCM(4,6,9)\cdot GCD(54,36,24) = 36\cdot 6 = 216 = \prod_{i=1}^{3} a_i. \ \checkmark

    Observation 3

    Why is the GCD of the co-products the right one, not that of the ai? For N=2, the GCD "captures" the factors common to the two numbers. For N≥3, however, a factor can be common to two of the ai without being common to all N — information that the "total" GCD GCD(a₁,…,aN) (which requires commonality across all of them) loses, but that the GCD of the co-products correctly recovers: each co-product "sees" N−1 of the factors, so a factor common to N−1 numbers still shows up in the GCD of the co-products even if it isn't common to all N.

    Delicate case 1 (Why the nonzero-natural-numbers hypothesis is needed)

    The hypothesis "a₁,…,aN nonzero natural numbers" is not decorative. If some ai=0, unique prime factorization is not defined (0 has no factorization into primes), so the whole apparatus of Section 2 (exponents eij) collapses.

    With the usual conventions LCM(0,a)=0 and GCD(0,a)=a, one could try to check Theorem 1 "by hand" in the degenerate case n=0: n·m=0, while LCM(0,m)·GCD(0,m)=0·m=0 — the formula still holds for N=2, but only thanks to the convention LCM(0,·)=0 that zeroes everything out. For N≥3, with more zeros or mixed combinations, one has to check case by case, and equally clean behavior isn't guaranteed. This is why the article restricts itself, as stated from the start, to strictly positive natural numbers.

    To summarize the path we've taken: from the classic N=2 case (Section 1), through canonical factorization via maximum and minimum exponents (Section 2), to the generalization to N numbers (Section 3) — with the caveat, clarified here, that the GCD to use is that of the co-products, not of the ai themselves. The practical value is the same in both cases: for N=2, efficient computation of the LCM from a GCD algorithm; for general N, the same idea, provided it's applied to the right GCD.

    Comments

    Loading comments...

    Won't be published: only used for contact and moderation.

    0/3000 characters

    Anti-spam check in progress…

    © 2026 keenonmaths.org. Empowering mathematical minds worldwide.

    Educational articles are distributed under a Creative Commons BY-NC-ND 4.0 license.