primefactorization
Prime factorization is the process of expressing a positive integer greater than 1 as a product of prime numbers, each raised to a nonnegative integer exponent. The multiset of prime factors is unique: according to the Fundamental Theorem of Arithmetic, every such integer has a factorization n = p1^a1 p2^a2 ... pk^ak where the pi are distinct primes and the ai are positive integers. The factorization is unique up to the order of the factors. For 1, the concept is often left undefined or treated as the empty product.
Examples: 360 = 2^3 × 3^2 × 5; 84 = 2^2 × 3 × 7. Primes in the factorization
Computing factorization begins with trial division, testing divisibility by primes in increasing order until the remaining
Prime factorization is used to compute gcd and lcm via exponents, simplify fractions, and study arithmetic