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.

    3. The Generalization to N Numbers

    Theorem 2

    Given N nonzero natural numbers a₁,…,aN, we have

    ∏i=1Nai=LCM(a1,…,aN)⋅GCD(1a1∏i=1Nai, …, 1aN∏i=1Nai).\prod_{i=1}^{N} a_i = LCM(a_1,\dots,a_N)\cdot GCD\left(\frac{1}{a_1}\prod_{i=1}^{N}a_i,\ \dots,\ \frac{1}{a_N}\prod_{i=1}^{N}a_i\right).

    Observation 2

    The GCD on the right-hand side is not the GCD of the ai themselves, but of the N "co-products" (1/am)·∏ai — the product of all the ai except the m-th. For N=2, (1/a₁)(a₁a₂)=a₂ and (1/a₂)(a₁a₂)=a₁, so the GCD of the two co-products is simply GCD(a₁,a₂): the formula reduces exactly to Theorem 1. For N>2 this is no longer true (the co-product isn't the single ai), and it's precisely this difference that makes the generalization non-trivial — we explore it with a counterexample in Section 4.

    Proof. Using the definitions from Section 2, let's compute the GCD on the right-hand side. The m-th co-product factors as1am∏i=1Nai=∏j=1Kfj∑i=1Neij−emj.\frac{1}{a_m}\prod_{i=1}^{N}a_i = \prod_{j=1}^{K} f_j^{\sum_{i=1}^{N} e_{ij} - e_{mj}}.

    Since computing the GCD means selecting the minimum exponent over m=1,…,N, and minimizing ∑ieij−emj over m is equivalent to maximizing emj(the sum ∑ieij doesn't depend on m), the exponent of the factor fj in the GCD of the co-products is ∑ieij−maxi(eij). HenceGCD(1a1∏iai,…,1aN∏iai)=∏j=1Kfj∑i=1Neij−max⁡i(eij).GCD\left(\frac{1}{a_1}\prod_i a_i,\dots,\frac{1}{a_N}\prod_i a_i\right) = \prod_{j=1}^{K} f_j^{\sum_{i=1}^{N}e_{ij}-\max_i(e_{ij})}.

    The left-hand side of the claim is ∏iai=∏jfj∑ᵢeᵢⱼ, which is exactly the product of LCM(a₁,…,aN)=∏jfjmaxᵢ(eᵢⱼ) and the expression just found — an exponent identity that is trivially verified (maxi(eij) + [∑ieij−maxi(eij)] = ∑ieij). The claim is proved.

    ∎

    Let's explicitly verify the reduction to the N=2 case: setting N=2 in the general formula recovers

    a1a2=LCM(a1,a2)⋅GCD(a2,a1)=LCM(a1,a2)⋅GCD(a1,a2),a_1 a_2 = LCM(a_1,a_2)\cdot GCD(a_2,a_1) = LCM(a_1,a_2)\cdot GCD(a_1,a_2),

    which is exactly Theorem 1.

    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.