What This Calculator Does
This tool takes a set of two or more positive whole numbers and finds three things: the complete list of factors (divisors) of each number, the common factors shared by every number, and the greatest common factor (GCF), also known as the greatest common divisor (GCD). It is useful for simplifying fractions, factoring expressions, and homework in number theory.
How to Use It
Enter your whole numbers separated by commas, for example 136, 64, 24, 16, then read the results. Each number's factor list is shown in ascending order, followed by the common factors and the single GCF value. Use only positive integers; zero, negatives, and decimals are not valid divisor inputs.
The Formula Explained
An integer d is a factor of n when \(n \bmod d = 0\). To find all factors quickly we loop i from 1 up to the square root of n; whenever i divides n, both \(i\) and \(n/i\) are factors. The GCF of a list is found pairwise with Euclid's algorithm: while b is not zero, replace (a, b) with (b, a mod b); the leftover a is the GCD. The recurrence is:
$$\gcd(a, 0) = a, \quad \gcd(a, b) = \gcd(b, \; a \bmod b)$$
A handy fact is that the common factors of the whole set are exactly the divisors of the GCF:
$$\text{CommonFactors} = \{\, d : g \bmod d = 0 \,\}, \quad g = \gcd(n_1, n_2, \dots)$$
Worked Example
For 136, 64, 24, 16: factors of 16 are 1, 2, 4, 8, 16; factors of 24 are 1, 2, 3, 4, 6, 8, 12, 24; factors of 64 are 1, 2, 4, 8, 16, 32, 64; factors of 136 are 1, 2, 4, 8, 17, 34, 68, 136. Euclid gives \(\gcd(16, 24) = 8\), then \(\gcd(8, 64) = 8\), then \(\gcd(8, 136) = 8\), so the GCF = 8. The divisors of 8 are 1, 2, 4, 8 — those are the common factors.
FAQ
Is GCF the same as GCD? Yes. "Greatest common factor" and "greatest common divisor" are two names for the same value.
What if the numbers share no factors? Every set of positive integers shares the factor 1, so the common factors are at least {1} and the GCF is at least 1. Numbers whose only common factor is 1 are called coprime.
Can I enter just one number? Yes — its factors are listed and the GCF equals that number itself.