In arithmetics, the numbers by which we may divide an integer, their 'divisors', are quite important.

For instance, if you find a number that divides both the numerator and the denominator of a fraction, for instnace 2 for the fraction 6/4, then you may simplify the fraction: 6/4=3/2, because

6=2x3 and 4=2x2.

The integers that divide both the integer p and the integer q are called the 'common divisors' of p and q.

The positive common divisors of 2 integers p and q are all lower than both the absolute values of p and q, so that they are in finite number and have a maximum, the 'greatest common divisor' of p and q gcd(p,q).

For instance, the divisors of 8 are 1, 2, 4 and 8, and the divisors of 12 are 1, 2, 3, 4, 6 and 12, so that the common divisors of 8 and 12 are 1, 2 and 4, and the gcd is the greatest of these, i.e. 4.

If two numbers share only the positive divisor 1, that is that their greastest common divisor is 1, they are said to be 'relatively prime'.

Beware, 2 different prime numbers are relatively prime, but the some pairs of non-prime numbers are relatively prime. For instance, 2 and 3 are relatively prime, but also 4 and 9, that are not prime numbers.

For a fraction, it may not be simplified if and only if the numerator and the denominator are relatively prime. It is said to be 'irreducible'

But if we simplify a fraction by the greatest common divisor of the numerator and the denominator, the result may not be simplified further, otherwise the gcd multiplied by the common divisor of the new numerator and denominator should be a common divisor of the previous numerator and denominator that should be grater than their gcd, that is contradictory.

Thus, if we simplify a fraction by the gcd of the numerator and denominator, we obtain an equivalent fraction with relatively prime numerator and denominator.

That fraction that can not be simplified is called the 'canonical form' of the rational number. More precisely, the canonical form of a rational number is the unique irreducible fraction with positive denominator that represents the fraction.

For instance, as gcd(8,12)=4, the fraction 8/12 may be simplified by 4 to obtain its canonical form 8/12=2/3.

We may of course do it stepwise, simplifying by 2 two times: 8/12=4/6=2/3, that is an irreducible fraction because 2 and 3 are relatively prime.

These are the two main ways to obtain the canonical form of a fraction…