Skip to main content

Factorization Visualizer Calculator

Calculate factorization visualizer instantly with our math tool. Shows detailed work, formulas used, and multiple solution methods.

Share this calculator

Formula

n = p1^a1 * p2^a2 * ... * pk^ak (Fundamental Theorem of Arithmetic)

Every integer greater than 1 has a unique prime factorization. The number of divisors equals the product of (ai + 1) for each prime power. Euler totient phi(n) = n * product of (1 - 1/pi) for each distinct prime factor pi.

Worked Examples

Example 1: Factorization of 360

Problem: Find the complete prime factorization of 360 and determine its total number of divisors.

Solution: Factor tree: 360 = 2 * 180 = 2 * 2 * 90 = 2 * 2 * 2 * 45 = 2 * 2 * 2 * 3 * 15 = 2 * 2 * 2 * 3 * 3 * 5\nPrime factorization: 360 = 2^3 * 3^2 * 5^1\nNumber of divisors = (3+1)(2+1)(1+1) = 4 * 3 * 2 = 24\nSum of divisors = 1170\nEuler totient = 360 * (1-1/2)(1-1/3)(1-1/5) = 96

Result: 360 = 2^3 * 3^2 * 5 | 24 divisors | phi(360) = 96

Example 2: Comparing 360 and 840

Problem: Compare the factorizations of 360 and 840. Find their GCD and LCM.

Solution: 360 = 2^3 * 3^2 * 5\n840 = 2^3 * 3 * 5 * 7\nShared primes: 2, 3, 5\nGCD = 2^3 * 3^1 * 5^1 = 120 (minimum exponents)\nLCM = 2^3 * 3^2 * 5 * 7 = 2520 (maximum exponents)\nVerification: 360 * 840 = 302,400 = 120 * 2520

Result: GCD(360, 840) = 120 | LCM(360, 840) = 2520

Frequently Asked Questions

What is prime factorization?

Prime factorization is the process of expressing a positive integer as a product of prime numbers. The Fundamental Theorem of Arithmetic guarantees that every integer greater than 1 has a unique prime factorization (up to the order of factors). For example, 360 equals 2 cubed times 3 squared times 5, meaning 2 times 2 times 2 times 3 times 3 times 5. This representation is unique for every number, making it a fundamental fingerprint of each integer. Prime factorization is the basis for many number theory results and has practical applications in cryptography (RSA encryption relies on the difficulty of factoring large numbers), computer science, and solving problems involving divisibility, GCD, and LCM.

How do you find the total number of divisors from the prime factorization?

The total number of divisors can be calculated directly from the prime factorization without listing all divisors individually. If n equals p1 to the a1 times p2 to the a2 times pk to the ak, then the number of divisors tau(n) equals (a1 plus 1) times (a2 plus 1) times (ak plus 1). Each factor (ai plus 1) represents the choices for how many times prime pi appears in a divisor: 0, 1, 2, up to ai times. For example, 360 equals 2 cubed times 3 squared times 5, so the number of divisors is (3 plus 1)(2 plus 1)(1 plus 1) equals 4 times 3 times 2 equals 24. This formula is incredibly efficient compared to testing every potential divisor and is one of the most useful results in elementary number theory.

What is Euler totient function and how does it relate to factorization?

Euler totient function phi(n) counts the number of integers from 1 to n that are coprime to n (share no common factors with n other than 1). It is computed directly from the prime factorization: phi(n) equals n times the product of (1 minus 1/p) for each distinct prime factor p of n. For example, phi(360) equals 360 times (1 minus 1/2) times (1 minus 1/3) times (1 minus 1/5) equals 360 times 1/2 times 2/3 times 4/5 equals 96. The totient function is central to RSA cryptography, where it determines the modular multiplicative inverse used for decryption. It also appears in Euler theorem, which states that a raised to phi(n) is congruent to 1 modulo n when a and n are coprime.

What is the relationship between GCD, LCM, and prime factorization?

The greatest common divisor (GCD) and least common multiple (LCM) of two numbers can be computed directly from their prime factorizations. For each prime that appears in either factorization, the GCD uses the minimum exponent and the LCM uses the maximum exponent. For example, if 360 equals 2 cubed times 3 squared times 5 and 840 equals 2 cubed times 3 times 5 times 7, then GCD equals 2 cubed times 3 times 5 equals 120 and LCM equals 2 cubed times 3 squared times 5 times 7 equals 2520. A beautiful relationship connects them: GCD(a,b) times LCM(a,b) equals a times b. This factorization-based method is more intuitive than the Euclidean algorithm and clearly shows the shared structure of two numbers.

How does factorization relate to cryptography?

The RSA cryptosystem, one of the most widely used encryption methods, is built on the assumption that factoring large numbers is computationally difficult. RSA works by multiplying two large prime numbers p and q to get n equals p times q. The public key uses n, while the private key requires knowledge of p and q individually. Encryption and decryption are performed using modular exponentiation with exponents related through Euler totient function phi(n) equals (p minus 1)(q minus 1). Without knowing the factors p and q, an attacker cannot compute phi(n) and therefore cannot determine the private key. Current RSA keys use 2048-bit numbers (about 617 digits), which would take classical computers billions of years to factor. Quantum computers running Shor algorithm could theoretically factor these numbers efficiently, motivating post-quantum cryptography research.

How do I interpret the result?

Results are displayed with a label and unit to help you understand the output. Many calculators include a short explanation or classification below the result (for example, a BMI category or risk level). Refer to the worked examples section on this page for real-world context.

References