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
0
votes
1 answer

If $a \mid 6$ and $b \mid 2$, how to prove $lcm(a,b)$ can't be greater than $6$?

In this SE answer about showing that $\mathbb Z _6 \times \mathbb Z _2 $ doesn't have any element of order $12$, we have $(x,y)\in \mathbb Z _6 \times \mathbb Z _2$. It says that $o(x) \mid 6$ and $o(y) \mid 2$. It hence says that $lcm(o(x),o(y))$…
niobium
  • 1,177
0
votes
1 answer

If φ is a homomorphism, φ: G⟶G′, |G| and |G'| is finite, then for every g ∈ G, o(φ(g)) | (g.c.d(|G|,|G'|))

Assume $φ:G⟶G'$ is a homomorphism from $G$ to $G'$. prove: if $|G|,|G'|$ is finite then: $o(φ(g) | (g.c.d(|G|,|G'|))$. My proof: φ is homomorphism so we know $o(φ(g))|o(g)$ & G is a group so $o(g)||G|$ From the transitivity of the division…
0
votes
1 answer

Prove that there exist positive integers that divides none of the integers in a given set, and can be smaller than the gcd of the given integers.

The gcd cannot be a solution as the greatest common divisor, is the largest value, that divides all integers in the set. But, there can be positive integer values less than gcd, that are not divisor of any of the values in the set. Say, for the set…
jiten
  • 4,524
0
votes
0 answers

Proof: Suppose $a,b \in \mathbb{N}$. Then a = gcd(a,b) iff $a|b$.

So I've constructed a proof for this answer and I'm having trouble completeing it. To prove iff statements we need to prove the statment $P \rightarrow Q$ then $Q \rightarrow P$. Convert the statement into a conditional statement then prove the…
Ziggy
  • 147
0
votes
0 answers

Is there a simplification of the expression $\gcd\left(a y(p-q)-x(b-p q),y(a-pq)+x(p-q)\right)$?

Following the question gcd simplification, I was trying to see if $$\gcd\left(a y(p-q)-x(a-p q),y(a-pq)+x(p-q)\right)$$ with $\gcd(x,y)=1$ can be simplified. I tried to eliminate the variable $q$ and ended up with the expression $$\gcd\left(a…
0
votes
0 answers

GCD simplification

I was going through Bezout's identity and I had a question. Can we simplify $gcd(a*b,c+b*(d-e))$ using Bezout's identity? When I use the identity $gcd(a+m*b,b)=gcd(a,b)$ I am left with $gcd(a*b,c+b*(d-e))=gcd(a*b,c)$. Similarly,…
0
votes
0 answers

Nested GCD simplification

Let us assume two given co-prime integers $a$ and $b$. Let $d$ be another integer and $x_1$ and $x_2$ be two variables. Then is it possible to simplify this nested GCD expression $gcd\bigg(\frac{(x_1^2-d)(a^2-d b^2)}{gcd(a^2-d b^2; a-bx_1)};b(x_1…
0
votes
0 answers

Positive vs Negative HCF of Compound Algebraic Expressions

I was learning to find the Highest Common Factor of two compound algebraic expressions using the long division method. However, I encountered the following question which puzzled me to a great extent: Find the HCF of : $x^3$ - $x^2$ - 5x - 3 and…
0
votes
0 answers

GCDs of two expression is one of the expression itself

Given integer constants $a,b,d$ ($a,b$ are coprime) and an integer variable $x$, is there a way to easily find for which $x$ does $gcd(a^2-db^2,a-bx)=a^2-db^2$ without substituting the values of $x$ individually and calculating the gcd? This is a…
0
votes
0 answers

Question regarding GCD elimination

I have the following expression $GCD[d b(x-y)+a(d-x y), a(x-y)+b(d-x y)]$ where x and y are variables and a and b are co-prime. Now, if I eliminate the variable $x$ from the first expression of the GCD i.e. $d b(x-y)+a(d-x y)$ , I have…
0
votes
0 answers

GCD of two expressions with one variable

A friend of mine posed this question: Assume three constants $a,b$ and $d$ and one variable x. $a,b$ & $d$ are all integers and $a$ and $b$ are coprime.$x$ can also be only an integer. Now, is it possible to calculate $GCD(a*x-d*b,a-b*x)$ without…
0
votes
0 answers

GCD-LCM problem of three integers

Question:- The sum of three positive integers is 396 and their HCF is 12. The LCM of the smallest and the largest numbers is 1224. The LCM of the largest two numbers is 2040. Find the difference between the smallest and the largest number. My…
Fin27
  • 958
0
votes
0 answers

lcm of 3 numbers--by a recursive formula?

$$ \DeclareMathOperator{\lcm}{lcm} \DeclareMathOperator{\gcd}{gcd} $$ I have to find the $\lcm(39,102,75)$. I am thinking of using a recursive formula like this: $$ \lcm(39,102,75) = \frac{\lcm(39 \times 102) \times 75}{\gcd(39,102,75)} =…
0
votes
1 answer

Calculating a Least Common Multiple with shifts

I'm writing a program where one part of it has to calculate a LCM with "shifted" values. The idea behind it is quite hard to describe for me, so I'll give you an imaginative representation of it: Imagine we have got two sets of bricks: one of 20cm…
Felix.leg
  • 111
0
votes
0 answers

When finding the LCM of two numbers, why is one number left out of multiplying when it is repeated in the multiples?

For example, the LCM of 10, 24. In factoring the two numbers, there are 4 twos, one 3, and one 5. But, in using compact or exponents to find the LCM, the correct form is 2 cube, multiplied by 3, multiplied by 5, which is 120. However, I get…