Math

Prime Factorization Calculator

Find the prime factorization of any positive integer up to 1 billion. See prime factors with exponents, number of divisors, sum of divisors, and Euler's totient.

Quick Answer

Prime factorization breaks a number into its prime building blocks. For example, 360 = 2³ × 3² × 5. Every integer greater than 1 has a unique prime factorization (Fundamental Theorem of Arithmetic).

Enter a Positive Integer

Enter a number between 2 and 1,000,000,000.

Prime Factorization
360 = 2³ × 3² × 5
Prime Factors
3
Total Divisors
24
Sum of Divisors
1,170
Euler Totient φ(n)
96

Factor Breakdown

PrimeExponentValue
238
329
515

Step-by-Step Division

360÷2=180
180÷2=90
90÷2=45
45÷3=15
15÷3=5
5÷5=1

All Divisors (24)

1234568910121518202430364045607290120180360

About This Tool

The Prime Factorization Calculator decomposes any positive integer into its prime factors, displaying them with exponents in a clean, readable format. Beyond the factorization itself, it computes the number of divisors, the sum of all divisors, and Euler's totient function. It also lists every divisor of the number and shows a step-by-step division process. This tool is invaluable for number theory students, competitive programmers, cryptography enthusiasts, and anyone who needs to understand the structure of integers.

The Fundamental Theorem of Arithmetic

The Fundamental Theorem of Arithmetic states that every integer greater than 1 can be represented uniquely as a product of prime numbers, up to the order of the factors. For example, 360 = 2³ × 3² × 5, and no other combination of primes produces 360. This uniqueness is not trivial to prove and forms the bedrock of number theory. The theorem guarantees that prime factorization is a well-defined operation, which is why it appears as a fundamental tool in mathematics and computer science.

Number of Divisors Formula

If a number n has the prime factorization p1ᵉ₁ × p2ᵉ₂ × ... × pkᵉᵏ, then the total number of positive divisors is (e1+1)(e2+1)...(ek+1). For 360 = 2³ × 3² × 5¹, the number of divisors is (3+1)(2+1)(1+1) = 4 × 3 × 2 = 24. This formula works because each divisor is formed by choosing an exponent from 0 to ei for each prime pi, giving independent choices that multiply together.

Sum of Divisors and Perfect Numbers

The sum of divisors function, denoted σ(n), adds up all positive divisors of n. For 360, this sum is 1170. A number is called perfect if the sum of its proper divisors (all divisors except itself) equals the number. The first few perfect numbers are 6, 28, 496, and 8128. Perfect numbers have fascinated mathematicians since antiquity. Euler proved that every even perfect number has the form 2ᵖ⁻¹(2 - 1) where 2 - 1 is a Mersenne prime. Whether any odd perfect numbers exist remains one of the oldest unsolved problems in mathematics.

Euler's Totient Function

Euler's totient function φ(n) counts how many integers from 1 to n are coprime to n (share no common factor other than 1). It is computed as φ(n) = n × (1 - 1/p1) × (1 - 1/p2) × ... × (1 - 1/pk). For 360, φ(360) = 360 × (1/2) × (2/3) × (4/5) = 96. The totient function is central to RSA encryption, where it determines the modular inverse used in the private key. It also appears in Euler's theorem: aᵗᵒᵗᵉⁿᵗ 1 (mod n) for any a coprime to n.

Applications in Cryptography

Modern cryptography, particularly RSA encryption, relies on the difficulty of factoring large numbers. While factoring small numbers is fast (as this calculator demonstrates), factoring a number with hundreds of digits that is the product of two large primes is computationally infeasible with current technology. This asymmetry between multiplication (easy) and factorization (hard) is the security foundation of RSA. Understanding prime factorization is therefore essential for anyone studying information security, blockchain technology, or secure communications.

Frequently Asked Questions

What is prime factorization?
Prime factorization is the process of expressing a composite number as a product of prime numbers. For example, 60 = 2^2 x 3 x 5. Every integer greater than 1 has a unique prime factorization according to the Fundamental Theorem of Arithmetic. Primes themselves are already fully factored (e.g., 7 = 7).
What is Euler's totient function?
Euler's totient function phi(n) counts how many integers from 1 to n are coprime to n (share no common factors). For example, phi(12) = 4 because 1, 5, 7, and 11 are coprime to 12. It is computed using the prime factorization: phi(n) = n * product of (1 - 1/p) for each distinct prime p dividing n. It is crucial in RSA cryptography.
What is the largest number this calculator can handle?
This calculator handles integers up to 1 billion (1,000,000,000). The trial division algorithm used is efficient enough for numbers up to this size, running in O(sqrt(n)) time. For very large numbers (hundreds of digits), specialized algorithms like Pollard's rho, quadratic sieve, or the general number field sieve are needed.
How is the number of divisors calculated?
If n = p1^e1 * p2^e2 * ... * pk^ek, the number of positive divisors is (e1+1)(e2+1)...(ek+1). Each divisor corresponds to choosing an exponent between 0 and ei for each prime pi. For example, 360 = 2^3 * 3^2 * 5^1 has (3+1)(2+1)(1+1) = 24 divisors.
What is a perfect number?
A perfect number equals the sum of its proper divisors (all divisors except itself). The first four perfect numbers are 6, 28, 496, and 8128. All known perfect numbers are even, and each corresponds to a Mersenne prime via the formula 2^(p-1)(2^p - 1). Whether odd perfect numbers exist is an open question in mathematics.
Why is factorization important in cryptography?
RSA encryption relies on the fact that multiplying two large primes is easy, but factoring their product is computationally infeasible for sufficiently large numbers. A 2048-bit RSA key involves a number with about 617 digits. No known algorithm can factor such numbers in reasonable time, making RSA secure for practical purposes.

Was this tool helpful?