Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems On GPUs In Databases

Authors: Johns Paul ,Shengliang Lu ,Bingsheng He

1st Edition

1680838482, 978-1680838480

More Books

Students also viewed these Databases questions

Question

( 4 pts ) Find the duals of these Boolean expressions. a ) pts

Answered: 1 week ago

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago

Question

e. What do you know about your ethnic background?

Answered: 1 week ago