Section 1.2.6 - Example: Testing for Primality - Exercises 1.21 and 1.22