Primes and Factorisation: What a Number Breaks Into

Open Tool Prime Factorization Tool

Four switches, four outputs

Fields take the number to factor, an optional second number for common divisors and multiples, and a prime-table limit, with switches for prime factorisation, all divisors, the prime table, and common divisors with multiples. Controls start, load a sample, clear and copy. Together they cover typical exercises: factoring, counting divisors, greatest common divisor, least common multiple and primality.

Steps

  1. Enter the number and load the sample to see output shape.
  2. Enable factorisation to get a product of prime powers form.
  3. Enable all divisors when counting or summing them.
  4. Enter a second number and enable common values to get the greatest common divisor and least common multiple.
  5. Set a limit and enable the prime table when you need a list.
  6. Copy the result, clearing before another number.

Algorithm and boundaries

Trial division starts at two and need only reach the square root, since factors beyond it pair with smaller ones, making primality tests cheaper than intuition suggests. Factorisation is unique by the fundamental theorem of arithmetic: every integer above one is a unique product of prime powers. Divisor count multiplies exponents plus one, so three hundred sixty with three, two and one exponents yields four times three times two, twenty-four divisors. The greatest common divisor multiplies shared primes at their smaller exponents, and the least common multiple uses larger ones. One is neither prime nor composite, and two is the only even prime.

Common mistakes

Treating one as prime. Testing only odd numbers and missing two. Counting divisors without including one and the number. Multiplying two numbers for the least common multiple without dividing by the divisor first. Setting a limit so large the browser stalls. And confusing factorisation with the divisor list.

Where factoring stalls

Huge numbers need probabilistic primality tests. Modular arithmetic needs specialised tools. Factoring for cryptographic analysis is far beyond general tooling. And any large factorisation deserves a size estimate first.

⏫︎