Prime Factorization Calculator
Splits a whole number of 2 or more into its prime powers by trial division: type 360 and read back 2^3 · 3^2 · 5, the unique decomposition.
Factorization
—
Prime factorisation and the fundamental theorem of arithmetic
The fundamental theorem of arithmetic says that every integer above 1 factors into primes in exactly one way, give or take the order of the factors. Euclid knew this around 300 BC, and Gauss gave it a rigorous proof in Disquisitiones Arithmeticae (1801). Take 60 = 2² · 3 · 5: no other combination of prime powers lands on 60. The plainest way to find it is trial division. You divide by 2, then 3, 5, 7, 11, and so on up to sqrt(n); if nothing divides by then, whatever is left is prime itself. Worst case, that costs O(sqrt n).
Once the numbers get really big, trial division gives way to faster algorithms. Pollard's rho handles medium-sized factors, then come the quadratic sieve and GNFS (general number field sieve), which is the best classical algorithm we have. On a quantum computer, Shor's algorithm would factor in polynomial time. For now RSA-2048 stays out of reach in practice, and that stubbornness is exactly what public-key cryptography is built on.
Applications
- RSA cryptography: its security rests on how hard it is to factor the product of two large primes.
- Counting divisors: when
n = p₁^e₁ · p₂^e₂ ..., you getd(n) = ∏(eᵢ + 1). So 60 has 3 · 2 · 2 = 12 divisors. - ENEM, vestibular and olympiad problems involving GCD, LCM and simplifying fractions.
FAQ
Why stop trial division at sqrt(n)? Suppose n = a · b with a ≤ b. Then a ≤ sqrt(n). Any factor sitting above sqrt(n) has a smaller partner that you would have caught already.
Is 1 a prime? No. Leaving 1 out is what keeps the factorisation in the fundamental theorem unique.
How big a number can this handle? Trial division clears numbers up to about 10¹² in a fraction of a second. Past that point you need the heavier machinery, like Pollard's rho or GNFS.
Related Tools
Prime Factorization
Decompose any number into its prime factors. Instant result with the complete factorization.
Prime Number Checker
Check if a number is prime. Shows the prime factorization, the previous prime and the next prime. Instant result.
Loss on Ignition (Ceramic)
Compute the loss on ignition (LOI) of a ceramic raw material, LOI = (mass before − mass after ignition)/mass before·100%, the mass lost during heating at high temperature. It corresponds to the release of combined water (clay minerals), the burning of organic matter and the decomposition of carbonates (releasing CO₂). A high LOI indicates much clay/volatile matter and requires care to avoid defects (bubbles, cracks). Enter the mass before and after ignition.
Film Fixer Quantity by Rolls
Estimates ml of fixer required by number of 35mm rolls.
Street Art Spray Area Calculator
Estimates spray cans for urban art per square meter of mural.
Eave Solar Protection Brazil Calculator
Computes minimum eave overhang length to shade window from summer sun considering latitude and window opening height in meters.
The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.