Loading Learn…
Goal
Factorise a number into primes and count its positive divisors from the exponents.
A prime is an integer greater than 1 whose only positive divisors are 1 and itself. 2 is the only even prime. 1 is not prime, because it has only one positive divisor. A composite number has a positive divisor other than 1 and itself.
Write the number as a product of primes, n = p^^^c. Every positive divisor is made by choosing an exponent from 0 to a for p, from 0 to b for q, and so on. The count of positive divisors is (a + 1)(b + 1)(c + 1).
The formula counts 1 and the number itself. For a prime, the form is , so there are 2 divisors, which matches the definition.