Module reikna::prime [] [src]

Module for working with prime numbers.

This module has functions for generating prime numbers using a variety of different sieves, testing if numbers are prime or composite, and preforming simple factorizations.

Constants

S_SIEVE_SIZE

Size of the segmented sieve segments in segmented_eratosthenes()

Functions

atkin

Return a Vec<u64> of the primes in [1, max_u64] using the Sieve of Atkin.

eratosthenes

Return a Vec<u64> of the primes in [1, max_u64] using the Sieve of Eratosthenes.

factorize

Return a Vec<u64> of the value's factorization

factorize_wp

Return a Vec<u64> of the value's factorization, using the provided list of primes.

is_prime

Return true if value is prime, and false if it is composite.

prime_sieve

Idiomatic prime sieve, returns a Vec<u64> of primes in [1, max].

segmented_eratosthenes

Return a Vec<u64> of the primes in [1, max] using a segmented Sieve of Eratosthenes.