Loading [Contrib]/a11y/accessibility-menu.js

# Python Prime Number Sieves

sanghan
8,967 views

## Prime Sieves and Python Data Structures

One of those recurring problems requires efficiently calculating and testing for prime numbers. The first algorithm that comes to mind is The Sieve of Eratosthenes.

The Sieve, is one of many prime sieves, and is a simple yet time efficient algorithm for finding all the primes below a certain limit.

A prime number is a natural number that has exactly two distinct natural number divisors: 1 and itself. Make note that we do not consider 1 a prime number albeit also not being composite.

Is 2 a prime number
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
Online Participants