Problem 1. Write a C++ function that inputs a positive integer and determines whether it is prime using trial division.
Use your function from Problem 1 to write a C++ program for solving each of the following computational problems. For each problem, find the running time function of the algorithm you are using to write the corresponding program.
Problem 2. Determine whether 2^? โ 1 is prime for each of the primes not exceeding 100.
Problem 3. Find as many primes of the form ?^2 + 1, where n is a positive integer, as you can.
Note: Problems 2 and 3 are not related to each other. You need to develop a separate program for each problem. Your programs should invoke your function from Problem 1.
For Part 1, submit your C++ programs, test results, and make a conclusion.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here