Fundamental Theorem of Arithmetic Proof
Theorem 1
Every natural number has a unique prime factorization . The order of the primes is ignored.
Explanation
It may seem strange that a property we’ve naturally used since elementary school requires proof, but it is extremely important. The fact that this is so simple perhaps serves as evidence that it merits the name theorem.
Proof
Elementary Proof
Part 1. Existence
Given and , and , there exists a unique prime factorization. For all possible , let’s find the prime factorization, and say the last number is . Here, could be a prime or a composite number, so let’s check both cases.
- Case 1. If is Prime
If is a prime, then it is its own prime factorization. - Case 2. If is Composite
If is composite, it can be represented as the product of two natural numbers .
Since we’ve found the prime factorization for all natural numbers up to , , by simply multiplying, we obtain , thus we can determine the prime factorization of . Since we can find the prime factorization for in both cases, all natural numbers greater than have a prime factorization.
Part 2. Uniqueness
Now we need to show that is unique.
Assuming that has a non-unique prime factorization, so that holds. The order does not affect uniqueness, so for convenience, let’s say .
Prime Factorization Principle: If a prime divides a natural number such that , then must divide at least one of .
Since a prime dividing some number must divide at least one of its factors, must divide one of . The order is free, so a divisible by can be considered as , and could substitute for .
However, since is also a prime like , holds and , eliminating both from each side gives . The same method continues until one side becomes . If the other side is not , the product of primes must be greater than , making the equation invalid. Therefore, must hold, and finally, must be true.
■
Algebraic Proof
Algebraic Proof of the Fundamental Theorem of Arithmetic: The ring of integers ](../587) is a PID, thus a UFD.
■
Code
Below is the implementation of prime factorization in R. It’s fast because it doesn’t need to check for primes, using a list of primes instead. As an algorithm, it’s virtually useless. It returns the factorization in list form, which might be less readable. If you want it in exponential form, simply use the built-in function table()
on the returned vector.
prime = read.table("../attachment
/cfile8.uf@25411C3C5968BBE322F0D4.txt"); prime = prime[,1]
factorize<-function(p)
{
q=p
factors<-numeric(0)
i=1; j=1
while(q!=1)
{
if(q%%prime[i]) {i=i+1}
else
{
q<-q/prime[i]
factors[j]<-prime[i]
i=1
j=j+1
}
}
return(factors)
}
factorize(54)
factorize(101)
factorize(256)
factorize(420)
table(factorize(420))
Here is the result of running the code.
Silverman. (2012). A Friendly Introduction to Number Theory (4th Edition): p49. ↩︎