Break any number into its prime factors with a factor tree.
The Fundamental Theorem of Arithmetic states that every integer greater than 1 has a unique prime factorisation (up to ordering). For example, 360 = 2³ × 3² × 5. The factorisation is found by trial division: divide by 2 repeatedly until odd, then try 3, 5, 7, … up to √n. Any remaining factor greater than 1 must itself be prime.
Fundamental Theorem of Arithmetic
n = p₁^e₁ × p₂^e₂ × … × pₖ^eₖ (each pᵢ prime, unique up to order)
Number of divisors from factorisation
τ(n) = (e₁+1)(e₂+1)…(eₖ+1)
360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45. Then 45 ÷ 3 = 15, ÷ 3 = 5. So 360 = 2³ × 3² × 5. It has (3+1)(2+1)(1+1) = 24 factors.
The Fundamental Theorem of Arithmetic guarantees it: every integer > 1 is either prime or can be expressed as a product of primes in exactly one way, apart from the order of the factors.
Up to 1 000 000 000 (10⁹). Trial division to √(10⁹) ≈ 31 623 is fast in a browser. For larger numbers, more sophisticated algorithms like Pollard's rho are needed.