Questions tagged [gcd-and-lcm]

For questions related to gcd (greatest common divisor, also known as the hcf, the highest common factor), lcm (least common multiple), and related concepts from integer and ring theory.

The greatest common divisor (also known as highest common factor) of two or more integers is the largest integer that divides all of them. It may be computed using the Euclidean algorithm.

Bézout's identity states that for non-zero integers $a$ and $b$ there exist integers $x$ and $y$ with $ax+by=\gcd(a,b)$.


If $a, b \in \mathbb{N}$, write $a \mid b$ if $a$ divides $b$, i.e. there is $k \in \mathbb{N}$ such that $b = ka$.

The least (or lowest) common multiple of $a_1, \dots, a_k \in \mathbb{N}$ is the smallest positive integer $N$ such that $a_i \mid N$ for $i = 1, \dots, k$. We usually denote $N$ by $\operatorname{lcm}(a_1, \dots, a_k)$. Note that $\operatorname{lcm}(a_1, \dots, a_k)$ can be defined recursively from a binary definition. That is,

$$\operatorname{lcm}(a_1, \dots, a_k) = \operatorname{lcm}(\operatorname{lcm}(\dots\operatorname{lcm}(\operatorname{lcm}(a_1, a_2), a_3), \dots, a_{k-1}), a_k).$$

If $a, b \in \mathbb{N}$ and $a = p_1^{r_1}\dots p_m^{r_m}$, $b = p_1^{s_1}\dots p_m^{s_n}$ are their prime decompositions (where some of the $r_i$ and $s_j$ can be zero), we have

$$\operatorname{lcm}(a, b) = p_1^{\max(r_1, s_1)}\dots\ p_m^{\max(r_m, s_m)}.$$

Note that $\operatorname{lcm}(a, b)\operatorname{gcd}(a, b) = ab$.


These notions can be generalised to any commutative ring; the above is just the particular case of (positive elements of) the ring $\mathbb{Z}$.

2686 questions
-1
votes
2 answers

Find $\gcd(3^{20} + 3, 3^{21} +6)$

Find $\gcd(3^{20} + 3, 3^{21} +6)$ I am honestly so confused, I know $3$ divides both terms but am unsure if that's the $\gcd$.
user566482
-2
votes
2 answers

gcd between powers of two co-prime numbers

Is it true that $\forall x,y,n\in \mathbb{Z}$, if $\gcd(x,y)=1$ then $\gcd(x^n, y)=1$? If not, is there a counterexample?
qweruiop
  • 374
-2
votes
2 answers

GCD of $-90$ and $100$

Question: Find the greatest common divisor of $-90$ and $100$. Answer: The GCD of $-90$ and $100$ will also divide their sum, $10$. As $10$ divides $-90$ and $100$, the GCD of $-90$ and $100$ is $10$. Why is it this true: "The GCD of $-90$ and $100$…
-2
votes
1 answer

Factors and multiples

Four traffic lights along a street turn red at regular intervals of 1 minute,1 minute 10 seconds,1 minute 18 seconds and 1 minute 31 seconds respectively.Occasionally all four traffic lights will turn red simultaneously.If all traffic lights turned…
Karry
  • 15
-3
votes
1 answer

Show gcd(a,b) and gcd(a,c) are relatively prime

Let b and c ∈ Z. Suppose that b and c are relatively prime. Show that for all integers a, gcd(a, b) and gcd(a, c) are relatively prime.
-4
votes
1 answer

Prove ${\gcd\left({\rm lcm}\left(m_1,m_2\right),m_3\right){\rm lcm}\left(m_1,m_2,m_3\right)} = {\rm lcm}(m_1,m_2)m_3$

Is it possible to proof: when $gcd\left(m_1,m_2,m_3\right)=1$, then $\frac{lcm\left(m_1,m_2\right)m_3}{gcd\left(lcm\left(m_1,m_2\right),m_3\right)}=\frac{lcm\left(m_1,m_2,m_3\right)}{gcd\left(m_1,m_2,m_3\right)}$ is true for any positive integers $…
xMath
  • 95
-4
votes
2 answers

Simple Common Factor query

if $a|b$ and $a|c$, does it mean that $b|c$?
LucasCK
  • 101
-5
votes
1 answer

What is the slowest way to find the gcd of two numbers?

It is usually desirable to compute the greatest common divisor of two numbers efficiently, one such method being the Euclidean Algorithm. What about inefficient methods to find the $\gcd$ of two numbers? Have I found one? Equivalent to the "fifth…
john
  • 860
1 2 3
11
12