# Prime Factorization

A prime factorization calculator is presented whose input N is a positive integer greater than 1 and the output include:
- all the factors of N,
- the prime factors of N,
- the prime factorisation of N
- and the prime factorisation of N in exponential form.

We first review some of the definitions and theorems related to prime numbers and the prime factorization.
## Prime Numbers

A prime number is a positive integer greater than 1 that is not a product of two smaller positive integers.
In other words, a prime number has only two distinct positive divisors: 1 and itself.
Examples of prime numbers include 2, 3, 5, 7, 11, and so on.

## Unique Prime Factorisation Theorem

Any integer greater than 1 is either a prime number or it can be represented as a product of prime numbers in a unique way.

Prime factorization is the process of expressing a composite number as the product of its prime factors.
Prime factors are the prime numbers that multiply together to result in the original number.

For example, the prime factorization of 24 is 2 × 2 × 2 × 3, where 2 and 3 are prime factors.

## Example

Write the prime factorization of N = 120

Successive divisions of N by the prime numbers 2, 3, 5, 7, 11, 13, ...gives

\( \dfrac{120}{\color{red}2} = 60 \)

\( \dfrac{60}{\color{red}2} = 30 \)

\( \dfrac{30}{\color{red}2} = 15 \)

\( \dfrac{15}{\color{red}{3}} = 5 \)

\(\dfrac{5}{\color{red}{5}} = 1 \)

Hence the prime factorization of \( 120 \) is the product of the divisors

N = \( 120 = 2 \times 2 \times 2 \times 3 \times 5 \)

which may also be written in exponential form as follows: N = \( 120 = 2^3 \times 3 \times 5 \)