1) Write a program (an m-file) to compute the number of prime numbers for every century (i.e., # primes in the range [1-100], in [101-200], in [201-300], etc.) up to 100000. Plot your results. Approximately what percentage of numbers seems to be prime? Is this a good figure for all centuries?
Normally I could use primes, isprime or factor functions but my professor wants us to do it with loops, and conditional statements...
What I'm thinking that this could be a nested for loop? Could someone help me form this script please.What formula would i need to find the number of prime numbers for every century
Normally I could use primes, isprime or factor functions but my professor wants us to do it with loops, and conditional statements...
What I'm thinking that this could be a nested for loop? Could someone help me form this script please.What formula would i need to find the number of prime numbers for every century