[][src]Module reikna::prime

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.

Structs

Bitset

Simple bit set implementation for prime sieves

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.

next_prime

Return the smallest prime number greater than n.

nth_prime

Return the Nth prime number, starting with P0 = 2.

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.