### Approach 1. Integer numbers prime factorization:

#### Prime Factorization of a number: finding the prime numbers that multiply together to make that number.

#### 30 = 2 × 3 × 5;

30 is not a prime, is a composite number;

#### 40 = 2^{3} × 5;

40 is not a prime, is a composite number;

** Positive integers that are only dividing by themselves and 1 are called prime numbers. A prime number has only two factors: 1 and itself. *

* A composite number is a positive integer that has at least one factor (divisor) other than 1 and itself.

### Calculate the least common multiple, lcm:

#### Multiply all the prime factors, by the largest exponents (if any).

#### lcm (30; 40) = 2^{3} × 3 × 5;

## lcm (30; 40) = 2^{3} × 3 × 5 = 120

the numbers have common prime factors

## Approach 2. Euclid's algorithm:

### Calculate the greatest (highest) common factor (divisor), gcf, hcf, gcd:

#### This algorithm involves the operation of dividing and calculating remainders.

#### 'a' and 'b' are the two positive integers, 'a' >= 'b'.

#### Divide 'a' by 'b' and get the remainder, 'r'.

#### If 'r' = 0, STOP. 'b' = the GCF (HCF, GCD) of 'a' and 'b'.

#### Else: Replace ('a' by 'b') & ('b' by 'r'). Return to the division step above.

#### Step 1. Divide the larger number by the smaller one:

40 ÷ 30 = 1 + 10;

Step 2. Divide the smaller number by the above operation's remainder:

30 ÷ 10 = 3 + 0;

At this step, the remainder is zero, so we stop:

10 is the number we were looking for, the last remainder that is not zero.

This is the greatest common factor (divisor).

### Calculate the least common multiple, lcm:

#### Least common multiple, formula:

lcm (a; b) = ^{ (a × b) } / _{ gcf, hcf, gcd (a; b); }

#### lcm (30; 40) =

^{ (30 × 40) }/_{ gcf, hcf, gcd (30; 40) } =

^{ 1,200 }/_{ 10 } =

#### 120;

## lcm (30; 40) = 120 = 2^{3} × 3 × 5

## Final answer:

Least common multiple

lcm (30; 40) = 120 = 2^{3} × 3 × 5

The numbers have common prime factors.

### Why do we need the least common multiple?

#### In order to add, subtract or compare fractions you have to first build their denominators the same. This common denominator is nothing else than the least common multiple of fractions' denominators, also called the least common denominator, lcd.

#### By definition, the least common multiple of two integers, LCM, is the smallest positive integer larger than 0 that is a multiple of both.

## More operations of this kind: