Implementations of:
- Primes factorization
- Primes reduction
Writing a number as a product of prime numbers is called a prime factorization of the number. The terms in the product are called prime factors.
Given an input x:
-
If x is prime, print x and stop
-
Factor x into its prime factors p1,p2,…,pk
-
Let x = p1+p2+⋯+pk
-
Go back to step 1