euler-0.9.2: Mathematics utilities for Haskell

Copyright(c) Luis Rodrigues Soares, 2015
LicenseMIT
Maintainerluis@decomputed.com
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Numeric.Euler.Primes

Description

 

Synopsis

Documentation

isPrime :: Integral a => a -> Bool Source

The isPrime function checks whether a number a is prime by successively checking the remainder of the integer division with all numbers up to a-1.

trialAndDivision :: Int -> [Int] Source

The trialAndDivision function calculates prime numbers up to a certain limit by using the traditional (and very inneficient) trial and division method.

erastothenes :: Int -> [Int] Source

This is a naïve implementation of the Sieve of Erastothenes.

sundaram :: Int -> [Int] Source

An implementation of the Sieve of Sundaram.

atkin :: Int -> [(Int, Int)] Source

An implementation of the sieve of Atkin.