Skip to content

Xefea137/prime-sieves-python

Repository files navigation

Prime Number Sieves in Python

This repo contains different Python scripts to find prime numbers.

All three implementations are optimized to skip even numbers for better performance.


Scripts

1. sieve_of_eratosthenes.py

The classic method to find all primes up to a number upper_limit.


2. sieve_of_eratosthenes_triangular_sum.py

A more experimental version of the sieve of eratosthenes using triangular number logic.


3. segmented_sieve.py

Used for finding primes in a specific range, like [start, stop].


How to Run

Run any file with Python 3:

python sieve_of_eratosthenes.py

Releases

No releases published

Packages

No packages published

Languages