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
0 answers

Show that for all integers $n$, $\gcd(n^6 + 3n^2 + n + 4, n^2 + 1) = 1$

I got hold of the answer but I'm puzzled by two of the lines. Hoping someone can explain why how the solution is derived for the characters in bold. First, let's observe $\gcd(a,b) = 1$ $n^6 + 3n^2 + n + 4$ can thus be expressed as: //using…
nmr
  • 19
0
votes
0 answers

Find the smallest positive number which when increased by 17, is exactly divisible by both 520 and 468.

I actually know the answer. It is just finding the LCM. But when I checked with my calculator, it showed me a decimal number. The method I followed was to find LCM and subtract 17 from it. Is my method correct? Or should I go with any better method?…
0
votes
1 answer

Uniqueness of GCD when considering all integers.

I have a book that says that 6 and -6 are both greatest common divisors of 12 and 18, and thus a gcd is not uniquely defined. I have an obvious question about this. 6 >-6 so how is -6 also a gcd? I believe they say this because the definition of GCD…
Aniruddh
  • 333
0
votes
0 answers

prove that for every integer a it results gcd (a, a + 7) = gcd (a, 7)

how can I prove that for every integer $a$ results gcd ($a$, $a$ + 7) = gcd ($a$, 7) ?
0
votes
1 answer

Finding $y$ given that LCM of $x$ and $y$ is 720 and the LCM of $12x$ and $5y$ is 720

LCM of two numbers $x$ and $y$ is $720$ and the LCM of numbers $12x$ and $5y$ is also $720$. What is the number $y$? What I did - It is understood that $12$ is a factor of $y$ and $5$ is a factor of $x$ so the LCM of $12x$ and $5y$ and LCM of $x$…
user997730
0
votes
1 answer

Is it possible for three numbers to not have an LCM?

For a software application, I need to generate three very large sequences of numbers (say $n \gt 100000$) such that there are no common values. I think this problem boils down to finding three such numbers e.g. $x$, $y$, $z$, such that there is no…
Mojo
  • 99
0
votes
2 answers

There should be possibly infinite ordered triplets for the following question.

If L.C.M of three natural numbers $a, b, c$ is $p^2q^2r^2$(where $p, q, r$ are different prime numbers) such that sum of all possible triplets (a,b,c) are given by $m^n$ (where $m$ and $n$ are prime), then find the value of ($m-4n$) This is how…
0
votes
0 answers

gcd(a,b)=d. Let us have prime numbers k, l so that gcd(ak,bl) = d. Is this valid for all prime numbers?

Let us have two numbers, a, b, so that gcd(a,b)=d. Let us have two prime numbers k,l so that gcd(ak, bl)=d. Is this valid for all prime numbers or is there any conditions that must be met? I guess that it is valid for all prime numbers except those…
0
votes
2 answers

Sum of GCD and LCM is the sum of those numbers

I'm really stuck with this. Let $a,b\in \mathbb{Z}^+$ such that $$ GCD(a,b) + LCM(a,b) = a+b $$ then either $a|b$ or $b|a$. I tried using the fact that the GCD is a linear combination of the numbers or the equality $GCD \times LCM = ab $ without…
0
votes
0 answers

How to quickly identify common factors

What's a good approach for identifying potentially large common factors? For example, how do I quickly recognise that 123543/99900 is reducible to 371/300? Or putting this another way, how do I efficiently work out that 123543 and 99900 have the…
fractor
  • 101
0
votes
1 answer

Number of $1\leq n \leq 1000$ such that $\gcd(n,3000)=5$

How can I determine the number of $1\leq n \leq 1000$ with $n \in \mathbb N$ such that $\gcd(n,3000)=5$? 'gcd' stands for greatest common divisor. What would be a good way to solve this problem? I though about prime factorizations but perhaps there…
user826130
  • 329
  • 1
  • 8
0
votes
0 answers

Prove that $\gcd(a^{2^m}+1,a^{2^n}+1)=\begin{cases} 1,& \text{ if } a\ \text{is even;} \\ 2 & \text{ if } a\ \text{is odd.} \end{cases}$.

Show that if m> n, then $a^{2^n} + 1$ is a divisor of $a^{2^m} -1$. Show that if $ a, m, n \in \mathbb Z ^ + $ with $ m \neq n $, then $$\gcd(a^{2^m}+1,a^{2^n}+1)=\begin{cases} 1,& \text{ if } a\ \text{is even;} \\ 2 & \text{ if } a\ \text{is…
asd asd
  • 533
0
votes
0 answers

Need help understanding this tricky LCM problem.

[Moderators please note this is NOT a duplicate of GRE problem involving LCD, prime factorization, and sets. LCM. What am I missing? GRE test prep question [LCM and divisors] These posts only answer how 36 is the lowest value memeber of S, but not…
GRANZER
  • 583
0
votes
1 answer

Prove GCD statement with multiple variables

For positive integers $a_{1}, a_{2}\cdots, a_{k},$ define $\gcd(a_{1}, a_{2}\cdots, a_{k})$ to be the largest positive integer $d$ such that $d$ divides every $a_{i}$ and any positive integer $c$ that divides every $a_{i}$ also has to divide $d.$ Is…
Marcus F
  • 204
0
votes
3 answers

Is $GCD(2^n,(x^2+1)^{n-1})=1$

Let $x>1,n>2$ be positive integers. I come across the following problem: Is $$GCD(2^n,(x^2+1)^{n-1})=1$$ or $2^n$ is relatively prime to $(x^2+1)^{n-1}$ ? Is $$GCD(x^{2n},(x^2+1)^{n-1})=1$$ ? NB: $GCD$ is the greatest common divisor.
Safwane
  • 3,840