Prime Factorization
calculator.
Break a whole number into its prime factors, with a factor tree and the division steps.
- Divisors
- 24
- Distinct primes
- 3
- Primes with repeats
- 6
360 is built from 3 different primes used 6 times in all. The repeated primes mean it is neither square-free nor a perfect square. Its divisors pair up to multiply to 360, which gives 12 pairs.
Factor tree
360 splits into 18 × 20, and each branch splits until only primes are left: 2, 2, 2, 3, 3, 5.
Working
- 1Divide by the smallest prime that fits, again and again360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45, 45 ÷ 3 = 15, 15 ÷ 3 = 5, 5 ÷ 5 = 1
- 2Collect the primes you divided by360 = 2 × 2 × 2 × 3 × 3 × 5
- 3Write repeated primes as powers360 = 23 × 32 × 5
- 4Count divisors: add 1 to each exponent and multiply(3 + 1) × (2 + 1) × (1 + 1) = 24
- 5Check: multiply the prime powers back23 × 32 × 5 = 8 × 9 × 5 = 360
Division ladder
| Number | Divide by | Leaves |
|---|---|---|
| 360 | 2 | 180 |
| 180 | 2 | 90 |
| 90 | 2 | 45 |
| 45 | 3 | 15 |
| 15 | 3 | 5 |
| 5 | 5 | 1 |
All 24 divisors, in pairs
| Divisor | Pairs with |
|---|---|
| 1 | 360 |
| 2 | 180 |
| 3 | 120 |
| 4 | 90 |
| 5 | 72 |
| 6 | 60 |
| 8 | 45 |
| 9 | 40 |
Factor a list of numbers
Factorizations
| Number | Factors | Divisors |
|---|---|---|
| 84 | 2² × 3 × 7 | 12 |
| 90 | 2 × 3² × 5 | 12 |
| 96 | 2⁵ × 3 | 12 |
| 100 | 2² × 5² | 9 |
| 1,001 | 7 × 11 × 13 | 8 |
How it's worked out
Prime factorization writes a number as a product of primes. A prime is a number whose only factors are 1 and itself. Every whole number above 1 has exactly one such product, if you ignore the order. Repeated primes are written as powers.
The ladder divides by the smallest prime that goes in, then divides what is left, and stops at 1. For 360 that is 360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45, 45 ÷ 3 = 15, 15 ÷ 3 = 5, 5 ÷ 5 = 1. The primes on the left are the factors. The tool tries 2, then 3, then numbers of the form 6k ± 1, and it stops once the trial number passes the square root of what is left. Anything above 1 at that point must be prime.
A factor tree splits a number into any two factors, then splits each branch again until every branch ends in a prime. The tool starts with the pair closest to the square root, and you can pick another first split. The leaves are always the same primes.
The exponents tell you more. Each divisor takes each prime 0 times up to its exponent, so you add 1 to each exponent and multiply to count the divisors. For 360 that is 4 times 3 times 2, or 24. The sum of the divisors and Euler's totient, the count of numbers up to n that share no factor with it, come from the same exponents.
Worked examples
Priya checks her factor tree for 360
Priya started her tree with 2 × 180, but her friend started with 18 × 20. Both trees end in the same leaves: 2, 2, 2, 3, 3, 5. Grouped as powers, that is 2³ × 3² × 5.
Her tree is 4 splits deep and her friend's is 3, because 2 × 180 leaves a big branch to split. The answer does not change. The divisors pair up as 12 pairs, from 1 × 360 to 18 × 20, which matches the count of 24.
Sam adds fractions over 84 and 90
Sam needs a common denominator for two fractions, one over 84 and one over 90. Factored, 84 = 2² × 3 × 7 and 90 = 2 × 3² × 5. The GCD takes each shared prime to its smaller power: 2 times 3, or 6. The LCM takes every prime to its larger power, which gives 1,260.
So 1,260 is the smallest denominator that works for both. As a check, 6 times 1,260 equals 84 times 90. The same GCD puts the ratio 84 over 90 in lowest terms: 14 over 15.
Lena simplifies the square root of 72
Lena's homework asks for √72 in simplest form. Factored, 72 = 2³ × 3². Each pair of equal primes can leave the root as one prime: the 2 squared and the 3 squared come out as 2 times 3. One 2 is left with no partner, so it stays inside.
The same rule gives √360 = 6√10. A number whose exponents are all even, such as 36 = 2² × 3², has a whole square root.
Reading your result
Spread-out exponents mean many divisors. 5,040 = 2⁴ × 3² × 5 × 7 has 60 divisors, while 65,536 = 2¹⁶ is much larger and has only 17. Many small primes give many ways to pick a divisor.
Square-free means no prime repeats, as in 1001 = 7 × 11 × 13. Then the number equals the product of its distinct primes. Perfect square means every exponent is even. Those are also the only numbers with an odd count of divisors, since one divisor pairs with itself.
Large numbers can hide big factors. 2 to the 32 plus 1 is 4,294,967,297, and it looks as if it might be prime, but it splits as 641 × 6,700,417. Trial division finds 641 quickly. A number made of two primes that each have hundreds of digits is a different story, and no known method on an ordinary computer can split it. RSA encryption depends on that.
Common mistakes
- Stopping on a composite leaf. A branch that ends in 9 or 15 is not finished. Every leaf of the tree must be prime.
- Writing 1 as a factor. 1 is not prime, so it never appears in a prime factorization. 360 is 2³ × 3² × 5, not 1 × 2³ × 3² × 5.
- Adding the exponents to count divisors. For 360 the exponents add to 6, but the count is (3 + 1)(2 + 1)(1 + 1) = 24. You add 1 to each and multiply.
- Mixing up the GCD and the LCM. The GCD keeps only shared primes, each at the lower power. The LCM keeps every prime, each at the higher power, so it is never smaller than either number.