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.

    2. Canonical Factorization: GCD and LCM via Exponents

    Here we introduce the tool needed for the generalization to N numbers in Section 3, already presenting it in its general form (not just for N=2), so Section 3 can reuse it without redefining it.

    Given N nonzero natural numbers a₁,…,aN, each factors uniquely into primes. Let F={f₁,…,fK} be the set of all prime factors appearing in at least one of the factorizations (common and uncommon together). Then each ai is uniquely written as

    ai=∏j=1Kfjeij,i=1,…,N,a_i = \prod_{j=1}^{K} f_j^{e_{ij}}, \qquad i=1,\dots,N,

    where some exponents eij may be zero (the factor fj doesn't appear in the factorization of ai). From here, the GCD and LCM of N numbers can conveniently be defined as:

    LCM(a1,…,aN)=∏j=1Kfjmax⁡i=1,…,N(eij),GCD(a1,…,aN)=∏j=1Kfjmin⁡i=1,…,N(eij).LCM(a_1,\dots,a_N) = \prod_{j=1}^{K} f_j^{\max_{i=1,\dots,N}(e_{ij})}, \qquad GCD(a_1,\dots,a_N) = \prod_{j=1}^{K} f_j^{\min_{i=1,\dots,N}(e_{ij})}.

    Observation 1

    If a factor fj is not common to all the ai, its minimum exponent is 0, so it doesn't appear in the factorization of the GCD — exactly the classical criterion "the GCD is computed only over common factors." This max/min definition is therefore equivalent to the school-textbook one, just more convenient to manipulate algebraically, since it treats all factors (common and not) uniformly instead of distinguishing them case by case.

    Using these definitions with N=2, let's re-prove Theorem 1 in a purely algebraic way.

    Alternative proof. Let c₁,…,ck be the factors common to n and m, with exponents en,α and em,α respectively, and let un,1,…,un,i and um,1,…,um,j be the uncommon factors of n and m respectively. ThenGCD(n,m)=∏α=1kcαmin⁡(en,α,em,α),LCM(n,m)=∏α=1kcαmax⁡(en,α,em,α)⋅∏βun,βen,β′⋅∏γum,γem,γ′.GCD(n,m) = \prod_{\alpha=1}^{k} c_\alpha^{\min(e_{n,\alpha},e_{m,\alpha})}, \qquad LCM(n,m) = \prod_{\alpha=1}^{k} c_\alpha^{\max(e_{n,\alpha},e_{m,\alpha})} \cdot \prod_{\beta} u_{n,\beta}^{e'_{n,\beta}} \cdot \prod_{\gamma} u_{m,\gamma}^{e'_{m,\gamma}}.

    Multiplying side by side and using the identity min(x,y)+max(x,y)=x+y on each common exponent:LCM(n,m)⋅GCD(n,m)=∏α=1kcαen,α+em,α⋅∏βun,βen,β′⋅∏γum,γem,γ′=n⋅m.LCM(n,m)\cdot GCD(n,m) = \prod_{\alpha=1}^{k} c_\alpha^{e_{n,\alpha}+e_{m,\alpha}} \cdot \prod_{\beta} u_{n,\beta}^{e'_{n,\beta}} \cdot \prod_{\gamma} u_{m,\gamma}^{e'_{m,\gamma}} = n\cdot m.

    This recovers Theorem 1 by purely algebraic means — a confirmation of the consistency between the two proofs.

    ∎

    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.