Math + Coding: when you just can’t get enough

Molly & George at Eel’s Creek

George’s (inefficient) solution with Python

The first 10 primes found with the code above

George’s (inefficient) solution, with a plot of the first 100 prime numbers

The graph from the above code

Some things to think about

  • What if you plotted the first 1000 prime numbers?
  • How else could you plot the data generated by this code?
  • How could you change the code above so it uses Molly’s more efficient solution method? [Hint: Somehow you’ll have to remember the list of prime numbers you find. The second program already does this for you, in primeList.]
  • Here’s the code