Recurrences and arithmetic · Definition
Prime number
Before you start you need to know
Primes are the multiplicative building blocks of the integers: every number greater than 1 is built from them.
Definition
A prime number \(p\) is an integer greater than 1 whose only positive divisors are 1 and itself.
An integer greater than 1 that is not prime is called composite, and is a product of smaller integers: \(91=7\cdot13\). The number 1 is neither prime nor composite; excluding it is not arbitrary, since it keeps the factorization below unique. The only even prime is 2, and the first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29.
The fundamental theorem of arithmetic states that every integer \(n>1\) is a product of primes, in exactly one way up to order: \(360=2^3\cdot3^2\cdot5\). That uniqueness rests on Euclid's lemma: if a prime divides \(ab\), it divides \(a\) or \(b\). With it one computes greatest common divisors and the number of divisors (if \(n=p_1^{e_1}\cdots p_r^{e_r}\), there are \((e_1+1)\cdots(e_r+1)\)), and many proofs follow.
To decide whether \(n\) is prime it suffices to test the primes \(p\le\sqrt n\): if \(n=ab\) with \(a\le b\), then \(a\le\sqrt n\). Euclid proved there are infinitely many primes: if there were finitely many, \(p_1p_2\cdots p_r+1\) would have a prime factor outside the list. Primes underlie public-key cryptography, which relies on how hard it is to factor huge numbers.
Think about it
Why is 1 not considered prime, if it is only divisible by 1 and itself?
Because otherwise prime factorization would no longer be unique: \(6=2\cdot3=1\cdot2\cdot3\). By convention a prime must be greater than 1.
If \(n\) is not divisible by any prime less than or equal to \(\sqrt n\), what follows?
That \(n\) is prime: if it were composite it would have a proper factor at most \(\sqrt n\), and so some prime divisor in that range.
Exercises 10
- Which of these numbers is prime?
- How many prime numbers are less than 30?
- What is the smallest prime factor of 221?
- What is the prime factorization of 360?
- To decide whether 97 is prime by trial division, what is the largest prime you must test?
- Which of these statements about primes is true?
- How many positive divisors does 60 have?
- What is the smallest prime greater than 100?
- If a prime \(p\) divides the product \(ab\), what follows?
- For how many integers \(n>0\) is \(n^2-1\) prime?
What comes next
References
- Kenneth H. Rosen, Discrete Mathematics and Its Applications, 8th edition, McGraw-Hill, 2019. §4.3
- László Lovász, József Pelikán, Katalin Vesztergombi, Discrete Mathematics: Elementary and Beyond, 1st edition, Springer, 2003. cap. 6