Question
Part 1. Prime Numbers Design an algorithm to determine if a number is prime, and present it in: a) pseudocode; and b) a flowchart. Write
Part 1. Prime Numbers
Design an algorithm to determine if a number is prime, and present it in:
a) pseudocode; and b) a flowchart.
Write the corresponding code in Python.
Present screen shots of the results in which you test that code with 2 numbers that are not prime and 2 numbers that are prime.
Embed that code in a loop to print out all the prime numbers between 1 and 200.
(I HAVE ANSWERED PART 1, I JUST NEED HELP ON PART 2!)
Part 2. Riemann zeta function
Write the code in Python to evaluate the Riemann zeta function (of some input value called s) from its infinite series form truncated to some upper limit called M. Test the convergence of your calculation to known value at s=2 for various M. What is the smallest value of M for which the truncated sum gives the right answer within 1% ?
Write the code in Python to evaluate the Riemann zeta function (of some input value called s) from its infinite product form truncated to some upper limit called P. Note that the product form is over the prime numbers so you will need to use some of the code you wrote in part 1 to do this. Test the convergence of your calculation to known value at s=2 for various P. What is the smallest value of P for which the truncated product gives the right answer within 1% ? Again present screen shots of the Python code you wrote to do these calculations.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started