Talk:Greatest common divisor

Algorithms
Hi, I think the section on how to compute GCD ought to link to Lehmer's algorithm. The binary algorithm is great for numbers fitting in one or few computer words, but above that size up to bignums of several hundred digits, Lehmer's algorithm is usually preferable.

For asymptotically fast algorithms, O(M(n) log(n)), it would be nice to link to a description of how that works. I'm thinking of it as an divide-and-conquer extension of Lehmer's algorithm, but making that extension work is somewhat tricky. Now there are some links on the very long page on Euclid's algorithm, but that's not so easy to find from here. (Disclaimer: I'm author of one of those references, https://www.ams.org/journals/mcom/2008-77-261/S0025-5718-07-02017-0/home.html).

81.229.89.233 (talk) 08:00, 20 April 2019 (UTC)
 * Sure, a link to Lehmer's GCD algorithm should appear in the article (it appears only in the navbox at the bottom of the article.
 * I agree that the computational sections of this article and of Euclidean algorithm are messes, and would require a complete rewriting (minor results are too much emphasized, and major results such as the complexity O(M(n) log(n)) are lacking or unsourced). Probably, an article "Fast integer GCD computation" would be useful, with a summary and a main article template in both articles.
 * As you seem competent for these questions, I suggest that you start the work, and I am ready to help you (not really for finding sources). D.Lazard (talk) 09:07, 20 April 2019 (UTC)


 * I've now added section on Lehmer's algorithm. I agree a "Fast integer GCD computation" article, covering both state of
 * the art and history, would be great. But also a fair amount of work. 85.225.209.112 (talk) 09:26, 16 June 2019 (UTC)

"Greatest common denominator" listed at Redirects for discussion
An editor has asked for a discussion to address the redirect Greatest common denominator. Please participate in the redirect discussion if you wish to do so. D.Lazard (talk) 14:46, 31 March 2020 (UTC)

Adding new "other method"
Hello, there is another way of expressing the gcd of two natural numbers a and b.


 * $$\gcd(a,b)=a - b - ab + 2\sum\limits_{k=1}^a \lfloor \frac{b}{a} k \rfloor $$

I give a source. Some people claim it can´t be verified. But give a couple of sources.

Youtube-Video -> not accepted PDF -> not accepted Blogpost on a webpage -> not accepted

Other mathematical articles have also youtube sources. But they exist. — Preceding unsigned comment added by Scityscit (talk • contribs) 18:12, 18 March 2021 (UTC)

What do I have to do that my editing will be accpeted? Is it okay, if I put a "Proof"-Box in the article?

Or can I create a entry in "proofwiki"?

Best regards --Scityscit (talk) 19:00, 18 March 2021 (UTC)


 * There are countless results about GCD. It would be pointless to include all of them. We rely on coverage by reliable sources to guide our editorial judgement about which ones to include in the article. If most treatments of GCD mention Pick's Theorem, then that's a good sign that we should include it here. As far as I can tell, that is not the case. Conversely, if only a few reliable sources mention them together, we probably shouldn't cover them together.
 * You should also be aware of WP's rules about constructive and collaborative editing. If there is a disagreement about the content of a page, you should discuss it on the Talk page, and not repeatedly re-insert your preferred version, especially when three different editors object. See Edit warring... but apparently you're aware of WP:3RR, because you stopped after three reverts. --Macrakis (talk) 20:04, 18 March 2021 (UTC)

Name for a number's set of prime factors?
Isn't there a name for the set comprising a number's prime factors (e.g., the two sets shown in the Venn diagram of in the "Using prime factorizations" subsection)? I see nothing in the various prime/composite-related articles. BMJ-pdx (talk) 14:37, 26 July 2021 (UTC)
 * "The prime divisors of $n$" is a phrase that is commonly considered as convenient. Not all sets needs to be named, and using too much set theory leads to pedantry. Compare "$p$ is a prime divisor of $n$" and "$p$ is a member of the set of the prime divisors of $n$". Both sentences are correct, but the second one requires to know what is a set in mathematics, and what is a member of a set. Note that the concept of set is less than 150 years old, while the concept of prime divisor is more than 2000 years old. D.Lazard (talk) 15:12, 26 July 2021 (UTC)
 * My motivation came from how simple a definition of GCD could be with a simple name for such: "GCD is the product of the members of the intersection of ..." (much simpler still in symbolic form).  Also, it could be used in a relatively simple proof that the square root of 2 (et. al) is irrational.  Granted, all possible without a nice terse name.  BMJ-pdx (talk) 15:48, 3 August 2021 (UTC)
 * "the two sets shown in the Venn diagram of in the "Using prime factorizations" subsection": This Venn diagramm does not show any set, but multisets, as there are repeated elements in them, which is not possible for sets. Another example that using set theory when it is not needed may be confusing. D.Lazard (talk) 16:10, 3 August 2021 (UTC)
 * I stand corrected. However, I don't share your apparent disdain of set theory :-)  (As an aside, introduction to set theory was a feature of the "New Math" that started to be taught in the 1960's, and was musically satirized by mathematician Tom Lehrer.)  BMJ-pdx (talk) 16:38, 3 August 2021 (UTC)

"Grootste gemene deler" listed at Redirects for discussion
An editor has identified a potential problem with the redirect Grootste gemene deler and has thus listed it for discussion. This discussion will occur at Redirects for discussion/Log/2022 February 13 until a consensus is reached, and readers of this page are welcome to contribute to the discussion. User:1234qwer1234qwer4 (talk) 02:40, 13 February 2022 (UTC)

gcd(0,0)
I always thought $$\gcd(0,0)=1$$, but anyway Properties 3 and 5 are conflicting.

3) gcd(a, 0) = |a|, for a ≠ 0, since any number is a divisor of 0, and the greatest divisor of a is |a|.[2][5] This is usually used as the base case in the Euclidean algorithm.

5) If m is a non-negative integer, then gcd(m⋅a, m⋅b) = m⋅gcd(a, b).

Darcourse (talk) 10:20, 21 February 2022 (UTC)
 * There is no conflict. However the second assertion supposes that gcd(0, 0) is defined as being 0. So, I have replaced "non-negative" by "positive" in the article. If gcd(0, 0) would be defined as 0, the second assertion could be left as it was, and "for a ≠ 0" could be removed from the first one.
 * Note that when gcd(0, 0) is defined, this is always as 0, as this is the only value that allows extending all properties to this case. D.Lazard (talk) 11:22, 21 February 2022 (UTC)

Euclid's algorithm principle
Let a and b be distinct natural numbers. Then gcd(a, b) =gcd(|a-b|, min(a, b)) 202.168.85.234 (talk) 05:04, 13 June 2022 (UTC)

Why not state the (extremely simple) formulas in generality?
The section Using prime factorizations begins with this:

" Greatest common divisors can be computed by determining the prime factorizations of the two numbers and comparing factors. For example, to compute $gcd(48, 180)$, we find the prime factorizations 48 = 24 · 31 and 180 = 22 · 32 · 51; the GCD is then 2min(4,2) · 3min(1,2) · 5min(0,1) = 22 · 31 · 50 = 12 The corresponding LCM is then 2max(4,2) · 3max(1,2) · 5max(0,1) = 24 · 32 · 51 = 720."

But the formulas for GCD and LCM of two integers are very important in number theory.

There's nothing wrong with examples, but:

Why not just state the general formulas for GCD and LCM instead of solely giving examples???

I hope someone knowledgeable about this subject can fix this.

The the dismissive last sentence of this section:

"In practice, this method is only feasible for small numbers, as computing prime factorizations takes too long"

is wholly inappropriate since "practice" means entirely different things — especially in a case like this — to pure mathematicians as compared with applied mathematicians.

I hope someone knowledgeable about this subject can fix this, too. 2601:200:C082:2EA0:19F5:EB17:C336:8B35 (talk) 05:13, 18 March 2024 (UTC)

HCF (abbreviation)
I was surprised to see in the edit history that the abbreviation HCF had been removed from the article. It's very common here in the UK, as a quick web search reveals, though I wouldn't like to say whether it's more or less common than GCD. (When I see GCD, I have to remind myself that it's a synonym for HCF.)

It was clumsily introduced in the article, and doesn't need actually using in the text, but I think its existence needs at least mentioning. Maybe it's less common among academic mathematicians than the general public—I've no idea—but it's a term I think plenty of readers will be familiar with and indeed be looking up when they land on this article. Musiconeologist (talk) 00:43, 3 April 2024 (UTC), ed. 01:38, 3 April 2024 (UTC)

Imprecise definition
The article defines the GCD as "the largest positive integer that divides each of the integers."; this is fatally incomplete because any number is divisible by any number, say 8 is divisible by 500; the result is not an integer but the definition in the article does not state this. The definition is more precisely stated as "the largest positive integer that divides each of the integers into integers." — Preceding unsigned comment added by 37.152.237.108 (talk) 09:06, 10 July 2024 (UTC)


 * The definition is unambiguous, since the word "divides" is linked to a definition that excludes divisions with non-integer results. D.Lazard (talk) 09:30, 10 July 2024 (UTC)