Factorization Visualizer Calculator
Calculate factorization visualizer instantly with our math tool. Shows detailed work, formulas used, and multiple solution methods.
Calculator
Adjust values & calculateFactor Tree
Divisor Pairs
All 24 Divisors
Comparison: 360 vs 840
Formula
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.
Last reviewed: December 2025
Worked Examples
Example 1: Factorization of 360
Example 2: Comparing 360 and 840
Background & Theory
The Factorization Visualizer applies the following established principles and formulas. Mathematics rests on a hierarchy of number systems, each extending the previous. The natural numbers (1, 2, 3, ...) support counting and ordering. The integers add negative values and zero, enabling subtraction without restriction. The rational numbers, expressible as p/q where p and q are integers and q is nonzero, close the system under division. The real numbers fill the gaps left by irrationals such as the square root of 2 or pi, forming a complete ordered field. The complex numbers, written as a + bi where i is the square root of negative one, complete the algebraic closure of the reals and allow every polynomial to have a root. Prime factorization states that every integer greater than one is uniquely expressible as a product of primes, a result known as the Fundamental Theorem of Arithmetic. Computing the greatest common divisor (GCD) of two integers relies most efficiently on the Euclidean algorithm: repeatedly replace the larger number with the remainder when it is divided by the smaller, until the remainder is zero. The last nonzero remainder is the GCD. The least common multiple (LCM) follows from the identity LCM(a, b) = |a * b| / GCD(a, b). Modular arithmetic defines equivalence classes of integers that share the same remainder under division by a modulus n. Fermat's Little Theorem and Euler's Theorem arise from this structure and underpin modern cryptography. Logarithms are the inverses of exponential functions. If b raised to the power x equals y, then the logarithm base b of y equals x. The natural logarithm uses base e, approximately 2.71828. Combinatorics counts arrangements and selections. The number of ordered arrangements (permutations) of r objects from n distinct objects is nPr = n! / (n - r)!. The number of unordered selections (combinations) is nCr = n! / (r! * (n - r)!). Pascal's triangle arranges these binomial coefficients so that each entry equals the sum of the two entries directly above it. The Fibonacci sequence, defined by F(1) = 1, F(2) = 1, and F(n) = F(n-1) + F(n-2), appears throughout nature and connects deeply to the golden ratio via Binet's formula.
History
The history behind the Factorization Visualizer traces back through the following developments. Mathematics as a systematic discipline traces to ancient Mesopotamia. Babylonian clay tablets dating to around 1800 BCE demonstrate knowledge of quadratic equations, Pythagorean triples, and base-60 arithmetic, suggesting a practical mathematical tradition far preceding Greek formalism. Euclid of Alexandria compiled the Elements around 300 BCE, establishing the axiomatic method that would define rigorous mathematics for over two thousand years. His work organized plane geometry, number theory, and proportion into logically chained propositions derived from a small set of postulates. The algorithm bearing his name for computing GCDs appears in Book VII and remains in use today. In the 9th century, the Persian scholar Muhammad ibn Musa Al-Khwarizmi wrote Al-Kitab al-mukhtasar fi hisab al-jabr wal-muqabala, the treatise whose title gave algebra its name. He systematized the solution of linear and quadratic equations and described procedures that operated on unknowns as objects, a conceptual leap away from purely numerical calculation. Rene Descartes introduced coordinate geometry in 1637 by uniting algebra and Euclidean geometry, allowing curves to be studied through equations. This synthesis set the stage for calculus. Isaac Newton and Gottfried Wilhelm Leibniz independently developed calculus during the 1660s and 1670s, triggering a priority dispute that lasted decades and divided British and Continental mathematicians. Carl Friedrich Gauss proved the Fundamental Theorem of Algebra in 1799, showing that every nonconstant polynomial has at least one complex root. His Disquisitiones Arithmeticae of 1801 established modern number theory. David Hilbert's formalist program at the turn of the 20th century sought to place all of mathematics on an explicit axiomatic foundation, a project that Kurt Godel's incompleteness theorems of 1931 showed to be fundamentally limited. Alan Turing's work in the 1930s on computability introduced the theoretical model of the stored-program computer and linked mathematical logic directly to the limits of algorithmic calculation. His proof that no algorithm can decide in general whether an arbitrary program will halt or run forever placed fundamental boundaries on what mathematics can mechanically determine, and it opened the discipline now known as theoretical computer science.
Frequently Asked Questions
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
Reviewed by Manoj Kumar, Mathematics Educator ยท Editorial policy