Assignment 1

Due Tuesday, June 26, in class

Note: The deadline for the program has been extended to Friday, June 29.
  1. (20 points) Write a program that takes an integer as input and outputs "prime" if the integer is prime and "composite" if the integer is composite.

    Notes:

    The next two problems require Fermat's Theorem, sometimes called Fermat's Little Theorem. (See pp. 217-218 of the Stallings book.) Since this was not covered in class, I'm postponing these until we discuss the theorem. If you want, you can do them now for extra credit.

  2. Extra credit: (5 points) Problem 7.6 from the Stallings book.
  3. Extra credit: (15 points) Problem 7.7. (That's 5 each for b and d, 5 total for a and c.)

Course home page