What the Factor Calculator Does
This Factor Calculator takes a single whole number and instantly returns two things: every factor (divisor) of that number, and its prime factorisation. A factor is any integer that divides your number evenly, leaving no remainder. The prime factors are the prime building blocks that multiply together to recreate the original number. It is a handy tool for homework, simplifying fractions, finding greatest common divisors, and exploring number properties.
How to Use It
There is just one input field, labelled "Find the Factors of:". Enter any integer (positive or negative) and the calculator does the rest. The tool works on the absolute value, so the factors returned are always positive. The supported range is any whole number smaller than 2,147,483,647 — anything at or above that limit will not be processed.
- 0 is treated as a special case and returns 0.
- Negative numbers use their absolute value (e.g. -12 gives the same factors as 12).
The Formula Behind It
Rather than checking every number up to your input, the calculator loops only from 1 up to the square root of the number. For each value i that divides evenly, it records both i and its paired quotient (number ÷ i). This square-root method finds factors in pairs, which is far faster for large inputs. The results are de-duplicated and sorted in ascending order. For the prime factorisation, it uses an established primes routine (Apache Commons Math) to break the absolute value down into its prime components.
$$\text{Factors} = \left\{\, d \in \mathbb{Z}^{+} : \left|\text{Number}\right| \bmod d = 0 \,\right\}$$
Worked Example
Enter 36. The loop runs from 1 up to 7 (just past \(\sqrt{36} = 6\)):
- 1 divides 36 → record 1 and 36
- 2 divides 36 → record 2 and 18
- 3 divides 36 → record 3 and 12
- 4 divides 36 → record 4 and 9
- 6 divides 36 → record 6 (its pair is also 6, so only once)
Sorted, the factors are: 1, 2, 3, 4, 6, 9, 12, 18, 36. The prime factors are: 2, 2, 3, 3 (since \(2 \times 2 \times 3 \times 3 = 36\)).
Frequently Asked Questions
What is the difference between factors and prime factors? Factors are all the numbers that divide evenly into your input. Prime factors are only the prime numbers that multiply together to form it. For 36, the factors include composite numbers like 12 and 18, while the prime factors are just 2, 2, 3, 3.
Why do negative numbers give positive factors? The calculator works with the absolute value, so -12 and 12 produce the same list of positive divisors.
Is there a size limit? Yes. Numbers must be below 2,147,483,647 (and above its negative). Values at or beyond that limit return no result.