Code


Prime numbers code

Prime numbers code


Posted By on Feb 22, 2018

Here is some Python code that uses Emily’s approach to find all the primes up to a specified number. Set ‘max’ to an integer up to which you want to find prime numbers. Click run. The code returns: a list of primes; the number of primes calculated from each oddish sequence; and the number primes up to ‘max’. The method is similar to the Sieve of Eratosthenes, but it only marks each non-prime once and...

Read More