Integers, divisors, and primes
8.1 Check (using the definition) that , , and for every integer .
8.2 What does it mean for , in more everyday terms, if (a) ; (b) ; (c) .
8.3 Prove that
(a) if and then ;
(b) if and then and ;
(c) if and then ;
(d) if and then either or .
8.4 Let be the remainder of the division . Assume that and . Prove that .
8.5 Assume that , and . Let be the remainder of the division , and let be the remainder of the division . What is the remainder of the division ?
8.6 (a) Prove that for every integer , .
(b) More generally, for every integer and positive integer ,
8.7 Are there any even primes?
8.8 (a) Prove that if is a prime, and are integers, and , then either or (or both).
(b) Suppose that and are integers and . Also suppose that is a prime and but . Prove that is a divisor of the ratio .
8.9 Prove that the prime factorization of a number contains at most factors.
8.10 Let be a prime and . Consider the numbers , , , , . Divide each of them by , to get residues . Prove that every integer from to occurs exactly once among these residues.
[Hint: First prove that no residue can occur twice.]
8.11 Prove that if is a prime, then is irrational. More generally, prove that if is an integer that is not a square, then is irrational.
8.12 Try to formulate and prove an even more general theorem about the irrationality of the numbers .
8.13 Show that among -digit numbers, one in about every is a prime.
8.14 Show by examples that neither the assertion in lemma 8.1 nor Fermat’s Little Theorem remain valid if we drop the assumption that is a prime.
8.15 Consider a regular -gon, and all -subsets of the set of its vertices, where . Put all these -subsets into a number of boxes: we put two -subsets into the same box if they can be rotated into each other. For example, all -subsets consisting of consecutive vertices will belong to one and the same box.
(a) Prove that if is a prime, then each box will contain exactly of these sets.
(b) Show by an example that (a) does not remain true if we drop the assumption that is a prime.
(c) Use (a) to give a new proof of Lemma 8.1.
8.16 Imagine numbers written in base , with at most digits. Put two numbers in the same box if they arise by cyclic shift from each other. How many will be in each class? Give a new proof of Fermat’s theorem this way.
8.17 Give a third proof of Fermat’s “Little Theorem” based on exercise 8.3.
[Hint: consider the product .]
8.18 Show that if and are positive integers with , then .
8.19 (a) .
(b) Let be the remainder if we divide by . Then .
8.20 (a) If is even and is odd, then .
(b) If both and are even, then .
8.21 How can you express the least common multiple of two integers, if you know the prime factorization of each?
8.22 Suppose that you are given two integers, and you know the prime factorization of one of them. Describe a way of computing the greatest common divisor of these numbers.
8.23 Prove that for any two integers and ,
8.24 Show that the euclidean algorithm can terminate in two steps for arbitrarily large positive integers, even if their g.c.d. is 1.
8.25 Describe the euclidean algorithm applied to two consecutive Fibonacci numbers. Use your description to show that the euclidean algorithm can last arbitrarily many steps.
8.26 Suppose that and the euclidean algorithm applied to and takes steps. Prove that and .
8.27 Consider the following version of the euclidean algorithm to compute :
(1) swap the numbers if necessary to have ; (2) if , then return ; (3) if , then replace by and go to (1).
(a) Carry out this algorithm to compute .
(b) Show that the modified euclidean algorithm always terminates with the right answer.
(c) How long does this algorithm take, in the worst case, when applied to two 100-digit integers?
8.28 Consider the following version of the euclidean algorithm to compute .
Start with computing the largest power of 2 dividing both and . If this is , then divide and by . After this “preprocessing”, do the following:
(1) Swap the numbers if necessary to have .
(2) If , then check the parities of and ; if is even, and is odd, then replace by ; if both and are odd, then replace by ; in each case, go to (1).
(3) If , then return as the g.c.d.
Now come the exercises:
(a) Carry out this algorithm to compute .
(b) It seems that in step (2), we ignored the case when both and are even. Show that this never occurs.
(c) Show that the modified euclidean algorithm always terminates with the right answer.
(d) Show that this algorithm, when applied to two 100-digit integers, does not take more than 1500 iterations.
8.29 Show that if has bits in base 2, then can be computed using less than multiplications.
8.30 Show that , for every integer .
[Hint: since , it suffices to prove that , and . Prove these relations separately, using the method of the proof of the fact that .]
Prev: 07-combinatorial-probability Next: 09-graphs