Definition of GCD: The greatest common divisor (GCD), also called highest common factor (hcf), of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers. For example, the GCD of 8 and 12 is 4, that is, gcd ( 8, 12 ) = 4.
The number 54 can be expressed as a product of two integers in several different ways:
54 x 1 = 27 x 2 = 18 x 3 = 9 x 6.
Thus the complete list of divisors of 54 is 1, 2, 3, 6, 9, 18, 27 and 54.
Similarly, the divisors of the number 24 are 1, 2, 3, 4, 6, 8, 12, 24.
From these two lists, we can see that the common divisors of 54 and 24 are 1, 2, 3, 6.
Of these, the greatest is 6, so it is the greatest common divisor: gcd (54, 24 ) = 6.