* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Prime numbers
Survey
Document related concepts
Transcript
Prime numbers Euler phi-function For n ∈ Z, n ≥ 1 [i.e., n ∈ N], the Euler phi-function, denoted φ(n), returns the number of positive integers [natural numbers] less than or equal to n which are relatively prime to n. Recall that ”relatively prime” means the gcd of the two numbers is 1. Also note that while 1 is not a prime number, it is considered to be relatively prime to other numbers, since gcd(1, a) = 1 for a > 1. Example: • Take the number 20. List the positive integers that are less than or equal to 20: • Which of these are relatively prime to 20? • How many are there? That’s the value of φ(20). This is obviously not a good approach for large numbers, so we need some results... If n = p is prime If p is prime, then φ(p) = p − 1. e.g φ(17) = 16. We could list this as a theorem, I suppose, but there’s not much of a proof - it follows immediately from the definition. Every natural number smaller than a prime is relatively prime to it; the numbers 1 to p − 1 are all relatively prime to p. If n = pi is a power of a prime Proposition: If p is a prime and i ≥ 1, then φ(pi ) = pi − pi−1 = pi 1 − p1 = pi−1 (p − 1) Example: What is the value of φ(194)? Proof logic • There are p − 1 numbers relatively prime to p. • Since pi is a power of a prime, any number greater than 1 that does not also have p as a divisor will be relatively prime to pi . • So the only numbers which are not relatively prime to pi are multiples of p: p, 2p, 3p, ..., pi−1p. So there are exactly pi−1 numbers not relatively prime to p. Note that total includes pi−1 p = pi itself; removing that one from the count leaves pi−1 − 1 • The total number of numbers between 1 and pi (including 1) is pi − 1 • And the difference between them must be the number of numbers that are relatively prime to pi : φ(pi ) = (pi − 1) − (pi−1 − 1) = pi − pi−1 If we have a product mn, where gcd(m, n) = 1 Theorem: Let m and n be positive integers that are relatively prime. Then φ(mn) = φ(m)φ(n) Example: What is the value of φ(35)? Put those together, and you can find φ(n) for any n based off its prime factorization. Example: Find φ(200). Proof The proof for the multiplicative property is tricky, but almost all of the overhead in it comes from the numbers being relatively prime. The simpler case would be if n were the product of primes: n = pq. Then φ(n) = φ(pq) = φ(p)φ(q) = (p − 1)(q − 1) This can mostly be done with simple algebra, and I’ll show that at the end, but I’ll walk you through an example that illustrates the selection process underlying the general proof, and where the difficulties lie. Follow the slideshow-within-the-slideshow...