Find primes fast: sieve of Eratosthenes and beyond

sieves, trial division

6 steps · about 1 h 3 min · Intermediate

  1. Sieve of Eratosthenes (video, Khan Academy Labs, 4 min)

    The sieve drawn out, from Khan's cryptography series.

  2. Finding Primes in Python with the Sieve of Eratosthenes (video, mCoding, 7 min)

    Writes it and makes it faster step by step.

  3. Sieve of Eratosthenes (article, cp-algorithms, 15 min)

    The standard reference: complexity, odd-only and segmented sieves, code.

  4. Software Drag Racing: C++ vs C# vs Python (video, Dave's Garage, 24 min)

    The same prime sieve raced in three languages, and why speed differs.

  5. PlummersSoftwareLLC/Primes (repo, Dave Plummer + community, 8 min)

    That sieve in dozens of languages, with benchmarks.

  6. kimwalisch/primesieve (repo, Kim Walisch, 5 min)

    One of the fastest real-world sieves; read the README's "how it works".