Primes Project - Homework 4

Due Wednesday, October 26.

Write a program that completes the following tasks.  When you are done, email me the source code.

In your program, you can create whatever functions you feel you need.  You should at least have these two functions:

bool isPrime(int x)
int numFactors(int x)

To test your program, you might want to try these:

7759 is prime
363751127 is prime

49106711 has factors {1, 6329, 7759, 49106711}
83106649 has factors {1, 7759, 10711, 83106649}

For some of those larger numbers, you may notice that it takes a long time unless you use the shortcut we talked about in class.  Remember: you don't have to try dividing by every number from 1 up to x to determine if x is prime or not.