Skip to content

MikeLawrenchuk/sieve-of-atkin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Sieve of Atkin

This is a Python implementation of the Sieve of Atkin, an optimized algorithm for finding all prime numbers up to a given limit.

Description

The Sieve of Atkin is a modern algorithm for finding all prime numbers up to a specified integer. Compared with the older Sieve of Eratosthenes, which marks off multiples of primes, the Sieve of Atkin does some preliminary work and then marks off multiples of squares of primes, thus achieving a better theoretical asymptotic complexity.

This Python program also includes a function to count the number of twin primes (pairs of primes that differ by 2) up to the given limit.

Requirements

This program requires Python 3.6 or later.

Usage

To run the program, save the Python file sieve_of_atkin.py and run it with Python:

python Atkin.py

About

Sieve of Atkin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages