[][src]Module reikna::factor

Module for working with integer factorization.

This module contains functions for factoring integers, computing the LCM and GCD of integers, and testing if integers are perfect squares and perfect cubes.

Constants

GOOD_BYTES

List of least significant bytes for values that could be perfect squares.

MAX_SMALL_NUM

The largest number considered "small" by quick_factorize_wsp().

Functions

coprime

Return true if a and b are coprime.

gcd

Find the GCD of a and b using the Euclidean algorithm.

gcd_all

Return the GCD of the set of integers

lcm

Return the LCM of a and b.

lcm_all

Return the LCM of the set of integers

perfect_cube

Return true if n is a perfect cube.

perfect_square

Return true if n is a perfect square.

quick_factorize

Return a Vec<u64> of value's prime factorization.

quick_factorize_wsp

Return a Vec<u64> of value's prime factorization, using sprimes as a list of small primes;

rho

Extract a factor of val using entropy as a seed value.