# Factorization

Playing around with prime numbers, I created this simple factorization program.
The interesting thing about prime factors is that they are unique. There can only be one way to multiply prime numbers to get $n$ where $n \in \mathbb{N}$ and $n \geq 2$ (excluding the commutative property).
For example, $2 \cdot 3 \cdot 7 = 42$ and that is the only way to multiply prime numbers to get to $42$.

# Python 2.7.7 Code
# Jonathan Frech 8th of April, 2016

# factorize n
def factor(n):
factors = []
while n > 1:
for _ in range(2, n+1):
if n % _ == 0:
factors.append(_)
n /= _
break

return factors

# execute the factorisation
def exe(n):
print ">>> factor(" + str(n) + ")"
print factor(n)
print

# examples
for _ in [10, 100, 1000, 10000, 88, 2345, 131313, 30135]:
exe(_)