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

$\gcd(A,B) \leq \gcd(B,A-B)$

I was reading the proof related to GCD from the Khan Academy website I understand the algebra but I cannot understand the reasoning of the following sentence. Let $C=A-B.$ Then $\gcd(A,B)$ must be less than or equal to, $\gcd(B,C),$ because…
Har
  • 155
0
votes
1 answer

Minimum number of operations required to make GCD equal to K

We are provided a set of numbers. We can increment or decrement any given number by 1. This is denoted as a single operation. The objective is to make the GCD of the entire set of numbers equal to K. We need to find the minimum number of operations…
0
votes
1 answer

Question on a property of gcd an linear combinations

(I don't know the formal definition of a Euclidian Space so if it is relevant, I'm asking whether this is true or not for integers and polynomials) Someone has recently brought to my attention that $(f:g) = (f: rf + sg)$. I thought that this was…
0
votes
1 answer

Invalid solutions as common factors

I thought of the equation (x-2)^2/(x-2)=0 Normally to solve it, I would cancel out (x-2) and then end up with x-2=0. I then would solve it by saying x=2. However, I realized that at the same time x cannot be 2 due to the reciprocal statement. The…
nabu1227
  • 879
0
votes
1 answer

If $\gcd(a,b)=1$ prove that $(a^2,b^2)=1$ or $2$.

Hello I have got the answer for question ie. if $\gcd(a,b)=1$ prove $(a+b,a-b)= 1$ or $2$ But I want to find answer for, if $\gcd(a,b)=1$ prove $(a^2,b^2)=1$ or $2$
Sanket
  • 11
0
votes
0 answers

Greatest common divisor of two highly composite numbers

Is the greatest common divisor of two Highly composite numbers an highly composite number? If not, has it the same number of divisors of the first lesser highly composite number? Here below the exceptions of the first question up to the 50th highly…
0
votes
1 answer

Find the third GCD by knowing two other greatest common divisors

The greatest common divisor of a natural number $n$ and $90$ equals 18. The GCD of $n$ and $120$ equals 12. How can I find the GCD of $n$ and $900$?
student28
  • 385
0
votes
1 answer

How can I prove that the GCD is less or equal than the square root of the numbers' sum?

The numbers $a$ and $b$ are natural numbers. $\frac{a+1}{b} + \frac{b+1}{a}$ is an integer number. How can I prove that $gcd(a, b) \le \sqrt{a+b}$?
student28
  • 385
0
votes
1 answer

What is the gcd of x+1 and x-1?

What is the $gcd$ of $x+1$ and $x-1$? The euclid algorithm says that it is 2, but I'm unsure, since if I divide $x+1$ by $x-1$, the remainder is 2.
Oana
  • 37
0
votes
1 answer

Show that $\phi(n)$ (Euler function) is even for $n>2$

Let $n\in\mathbb Z_{>0}$ and $a\in\mathbb Z$. a) Prove $\overline a=\overline{-a}\iff \overline a=\overline0.$ b) Prove that if $n$ is odd, then $\overline a=\overline{-a}\iff\overline a=\overline0,$ if $n$ is even, then $\overline…
Sha Vuklia
  • 3,960
  • 4
  • 19
  • 37
0
votes
1 answer

Generalization of Division by GCD

Let $x,y,z \in \mathbb{Z}$ where $x \neq 0$ or $y \neq 0$. If $z$ is a common divisor and $z \neq 0$, prove $$ gcd(x,y) / |z| = gcd(x/z, y/z)$$ I realize this can be written as $$ gcd( x/|z|, y / |z|) = gcd(x/z, y/z) $$ But I am unsure as to how to…
u123435
  • 173
  • 1
  • 5
0
votes
2 answers

GCD with remainder theorem proof

I was trying to understand the proof to the GCD theorem. It seems like I'm missing sommething though. I was reading it in this wikiproof article and the first proof uses the GCD with remainder theorem. I didn't really understand it, so I tried to…
0
votes
1 answer

What is the maximum gcd of these variables?

Two numbers n, m satisfy $0 < |2n−3m| ≤ 20$. What is maximum possible $gcd (m, n)$? Explain your answer. I got 20, with my explanation being that if it was greater than 20, such as 21, then 2n-3m will have to be 21 or a multiple of 21, which would…
Gerard L.
  • 2,536
0
votes
1 answer

The greatest common divisor of $\sum_\limits{k=0}^{5n-2}2^k$

I am not sure how the greatest common divisor of one number is defined. It can be $1$, or first greater number than $1$, or that number, or first smaller number from that given number. If $n=1\Rightarrow…
user300045
  • 3,449
0
votes
1 answer

How to prove that GCD(2K+2,4k)=2 and if GCD(a,b)=1, GCD(a,c)=1 -> GCD(a,bc)=1

How to prove that GCD(4k+2,4k) = 2 And if GCD(a,b)=1, GCD(a,c) = 1 Then GCD(a,bc)=1 $k,a,b,c \in \mathbb{Z}$
Tony
  • 1,044