factory-0.3.0.0: Rational arithmetic in an irrational world.

Safe HaskellNone
LanguageHaskell2010

Factory.Math.Implementations.Primes.Algorithm

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION

Synopsis

Types

Data-types

data Algorithm Source #

The implemented methods by which the primes may be generated.

Constructors

SieveOfAtkin Integer

The Sieve of Atkin, optimised using a PrimeWheel of optimal size, for primes up to the specified maximum bound; https://en.wikipedia.org/wiki/Sieve_of_Atkin.

SieveOfEratosthenes NPrimes

The Sieve of Eratosthenes (https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes), optimised using a PrimeWheel.

TrialDivision NPrimes

For each candidate, confirm indivisibility, by all primes smaller than its square-root, optimised using a PrimeWheel.

TurnersSieve

For each prime, the infinite list of candidates greater than its square, is filtered for indivisibility; http://www.haskell.org/haskellwiki/Prime_numbers#Turner.27s_sieve_-_Trial_division.

WheelSieve Int

wheelSieve.