Question: Task 3 : List of prime numbers Writing down a list of prime numbers ( 2 , 3 , 5 , 7 , 1 1

Task 3: List of prime numbers
Writing down a list of prime numbers (2,3,5,7,11,13,17,19,23,...) we can see that the 9th prime is 23 and the sum of the prime numbers below 15 is
2+3+5+7+11+13=41.
a) i) What is the 99th prime number?
ii) And what is the 9999th prime number?
b) Find the sum of all the prime numbers
i) below 1500? ii) below 1.5 Million?
Hints:
Start writing code that reproduces the examples given in the introduction. Use your
functions from Task 1.
For parts i) it is possible to nd the solution by brute force testing all numbers up to
the given limit for primality.
For parts ii) you have to improve your algorithms to deal with large numbers. In case
you cannot nd an algorithm which terminates within acceptable time, explain the measures you have taken and what options you have tested. What is the range of the largest numbers your algorithm can handle?
After submitting the corresponding test for value checking in the CBEM Moodle with
at least one correct value you can download a pdf with additional hints. in matlab

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!