Interactive · 2 questions

GCD and LCM stand for greatest common divisor and least common multiple, respectively. The GCD for a set of numbers is largest number such that all the numbers in the set are divisible by it. The LCM is the lowest number such that it is divisible by all the numbers in the set, that are being compared.

For example, the GCD of 1515 and 1010 is 55, because 55 is the largest number that both 1515 and 1010 are divisible by.

As for LCM, the LCM Of 1515 and 1010 is 3030, because 3030 is the lowest number that is divisible by both 1515 and 1010.

One way of computing GCD and LCM is through prime factorization. Calculating LCM through prime factorization was covered in a different explanation (which can be found here).

Example for explanation: Find the GCD of 1212, 1414, and 88. First, we need to factorize each number into its primes.

12=22∗312 = 2^2*3, 14=2∗714=2*7, and 8=238=2^3

Now we have to check between the numbers and see which factors are common. The greatest power of 22 that all 33 numbers have is 212^1. As for 33, 1212 has a factor of 33, but 1414 and 88 do not. Similarly, 1414 has a factor of 77, but 1212 and 88 do not. Thus, the GCD of 1212, 1414, and 88 is 22.

Try these problems:

Which is the GCD of 3030, 2020, and 1515?

Choose one answer

Learn a clever approach

Every problem comes with a worked solution, so even one you cannot crack shows you a new way to think. These are real problems from the AMC 8, AMC 10, AMC 12 and AIME, the national math competitions for middle and high school students, each with a worked solution on LIVE by Po-Shen Loh.

Interactive · 2 questions

We've seen a lot of factoring rules and proofs for small numbers, but what about factoring rules for any number? What's the rule for 77? 1313? 617617?

One fun thing we can do is derive rules for any number based on a very simple piece of information about it: when is this number exactly 11 away from a multiple of 1010?

We can start this off with an example and then look back and justify each step that we make. This may require some additional knowledge of variables and exponents.

First, we need to find a way to represent any number that we want to check for divisibility. One way to do this is to look at powers of 1010: any number is the sum of its ones digit, 1010 times its tens digit, 100100 times its hundreds digit, and so on. In summation notation, this is 10nan+...+102a2+101a1+100a010^na_n + ... + 10^2a_2 + 10^1a_1 + 10^0a_0, where ana_n is the digit at the nthn^{th} place.

For example, the number 128128 is 100+20+8=102×1+101×2+100×8100+20+8=10^2\times 1+10^1\times 2 +10^0\times 8, so a0a_0 would be 88, a1a_1 would be 22, and a2a_2 would be 11.

Brief intermission! Which of the following numbers is the smallest positive multiple of 1717 that is 11 away from a multiple of 1010?

Choose one answer

Read · 1 min

Greatest common divisor/factor (gcd) of two numbers m,nm,n is the greatest number that divides both mm and nn.

Least common multiple (lcm) of two numbers m,nm,n is the least positive integer number that is divisible by both mm and nn.

(Why don't we define least common divisor or greatest common multiple? )

Michael Yang's post has shown how to calculate gcd/lcm with prime factorisation. This explanation will give a generalisation for gcd/lcm with prime factorisation.

Let's say we consider two positive integers m,nm,n with unique prime factorisation m=p1α1⋯pkαkm=p_1^{\alpha_1} \cdots p_k^{\alpha_k} and n=p1β1p2β2⋯pkβkn=p_1^{\beta_1}p_2^{\beta_2} \cdots p_k^{\beta_k} with αi,βi≥0,i=1,2,⋯ ,k\alpha_i,\beta_i \ge 0, i=1,2, \cdots ,k. Then what can gcd⁡(m,n)\gcd (m,n) be equal to ? (Let gcd⁡(m,n)=G\gcd (m,n)=G for convenience).

One way to to try all numbers from 11 to min⁡{m,n}\min \{ m,n \} and pick the greatest number that divides both mm and nn. Another way to look at it is consider a prime factor p1p_1, if G=p1x⋅yG=p_1^x \cdot y with p1∤yp_1 \nmid y and x<min⁡{α1,α2}x< \min \{ \alpha_1,\alpha_2 \} then of course Gp1Gp_1 is also divisor of m,nm,n. We note that G<Gp1G<Gp_1 which contradicts to our greatest condition of GG. Thus, that means x≥min⁡{α1,β1}x \ge \min \{ \alpha_1, \beta_1 \}. Since xx can't be greater than min⁡{α1,β1}\min \{ \alpha_1, \beta_1 \} (why?) so x=min⁡{α1,β1}x= \min \{ \alpha_1, \beta_1 \}.

We do the similar thing to other prime divisor pip_i. After all, we will obtain gcd⁡(m,n)=p1min⁡{α1,β1}⋯pkmin⁡{αk,βk}.\gcd (m,n)= p_1^{\min \{ \alpha_1, \beta_1 \}} \cdots p_k^{\min \{ \alpha_k,\beta_k \}}. This is the general formula to find gcd based on prime factorisation. Similarly, what is lcm(m,n)\text{lcm} (m,n)?

It is lcm(m,n)=p1max⁡{α1,β1}⋯pkmax⁡{α1,β1}.\text{lcm}(m,n)= p_1^{\max \{ \alpha_1, \beta_1 \} } \cdots p_k^{\max \{ \alpha_1, \beta_1 \} }. Now, we can easily find gcd/lcm of any two numbers. What else can this formula be used for? It can be used to prove the following interesting fact: mn=gcd⁡(m,n)⋅lcm(m,n),mn=\gcd (m,n) \cdot \text{lcm} (m,n), which you can see the proof in here.

Now, we know to compute gcd⁡(m,n),lcm(m,n)\gcd (m,n), \text{lcm} (m,n), but what about lcm/gcd of some kk numbers? The idea is similar when computing with 22 numbers: If mi=p1α1i⋯pkαki,i=1,2,…,sm_i=p_1^{\alpha_{1i}} \cdots p_k^{\alpha_{ki}},i= 1,2, \ldots,s then gcd⁡(a1,…,ms)=p1min⁡(α11,α12,…,α1s)⋯pkmin⁡(αk1,αk2,…,αks).\gcd (a_1, \ldots, m_s)=p_1^{\min (\alpha_{11},\alpha_{12}, \ldots, \alpha_{1s})} \cdots p_k^{\min (\alpha_{k1},\alpha_{k2}, \ldots, \alpha_{ks})}.

Read · 1 min

Let a,b,ca,b,c be positive integers. Prove that gcd⁡(a,b,c)=gcd⁡(a,gcd⁡(b,c))=gcd⁡(gcd⁡(a,b),gcd⁡(b,c)).\gcd (a,b,c)= \gcd (a, \gcd (b,c))= \gcd (\gcd (a,b), \gcd (b,c)).

Read · 1 min

Problem: Let a,b,ca,b,c be positive integers. Prove that gcd⁡(a,b,c)=gcd⁡(a,gcd⁡(b,c))=gcd⁡(gcd⁡(a,b),gcd⁡(b,c)).\gcd (a,b,c)= \gcd (a, \gcd (b,c))= \gcd (\gcd (a,b), \gcd (b,c)).

Solution: Use prime factorisation.

Type a concept, like “slope” or “photosynthesis”.

↑ ↓ to choose · Enter to openSearch explanations and problems