Documentation
¶
Index ¶
- func Factorize(n int64) map[int64]int64
- func Generate(limit int) []int
- func GenerateChannel(ch chan<- int)
- func MillerRabinTest(num, rounds int64) (bool, error)
- func MillerTest(d, num int64) (bool, error)
- func NaiveApproach(n int) bool
- func PairApproach(n int) bool
- func Sieve(in <-chan int, out chan<- int, prime int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Factorize ¶
Factorize is a function that computes the exponents of each prime in the prime factorization of n
func GenerateChannel ¶
func GenerateChannel(ch chan<- int)
Generate generates the sequence of integers starting at 2 and sends it to the channel `ch`
func MillerRabinTest ¶
MillerRabinTest Probabilistic test for primality of an integer based of the algorithm devised by Miller and Rabin.
func MillerTest ¶
MillerTest This is the intermediate step that repeats within the miller rabin primality test for better probabilitic chances of receiving the correct result.
func NaiveApproach ¶
NaiveApproach checks if an integer is prime or not. Returns a bool.
func PairApproach ¶
PairApproach checks primality of an integer and returns a bool. More efficient than the naive approach as number of iterations are less.
Types ¶
This section is empty.