Hey it's a me again @drifter1!
Today we continue with Mathematics, and more specifically the "Number Theory" series, in order to get into the Factorization and Euclidean Algorithm. The Euclidean algorithm is perhaps the most important algorithm in Number theory.
So, without further ado, let's get straight into it!
Let's check if 5280 is divisible by 2-to-12 by applying the divisibility rules of the previous article.
Any given number can be factorized based on the divisors and those are mostly only the prime divisors, as all numbers can be represented by primes and their combinations.
For example, 5280 can also be written as:
5280 = 25 × 3 × 5 × 11.
which has been computed as follows:
It's now easier to see why the number is divisible by the previously proven numbers: 2, 3, 4, 5, 6, 8, 10, 11 and 12 if we take the numbers in corresponding pairs. Additionally, other possible divisors are for example 24 = 16, 25 = 32 or 2 × 11 = 22. So, a given number is divisible by every possible combination of its factors.
So, we now know how to check for the divisibility and have found a way to represent at least small numbers with ease based on their divisors.
Now the questions is:
Do we always have to factor the numbers or is there a way to check the common divisors between two numbers and maybe even of computing the greatest common divisor without having to factor the numbers?
That's when the Euclidean Algorithm comes into play...
The Euclidean Algorithm is a method for efficiently computing the greatest common divisor (GCD) of two integers.
The Euclidean algorithm goes as follows:
Let's calculate the GCD of 156 and 34.
and so the GCD is 2.
If the GCD wasn't 2 and was a larger number then dividing the two numbers by that number and repeating the process would provide us with the next common divisor. Repeating the process only makes sense when the GCD is not 1 or 2.
How one proceeds with calculating the quotient and remainder is a matter of personal preference. The most commonly used division is the so called Euclidean division which is taught in most schools. Of course, this algorithm takes a lot of time when the numbers are large.
For larger numbers, and when speed is key, a procedure for getting the result to the necessary a = bq + r format is the following:
Let's divide 17832 by 439.
So, 17832 = 439 × 40 + 272.
Mathematical equations used in this article, have been generated using quicklatex.
Block diagrams and other visualizations were made using draw.io.
And this is actually it for today's post!
Next time we will probably get into Prime numbers...
See ya!

Keep on drifting!