Millerâ€“Rabin primality test is an algorithm which determines whether a given number is probable prime. For more information go to http://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test
34 people like thisPosted: 7 years ago by Cesar Mendoza
Simple check if a number is prime. See also http://fssnip.net/2w.
2 people like thisPosted: 7 years ago by d95danb
Let's have some fun with higher order functions and instead of folding over a list, fold over the prime factors of a number. It can be optimized further by dividing out real primes instead of numbers of the form 6k+/-1, but it's not embarrassingly slow.
2 people like thisPosted: 7 years ago by Arjen Kopinga
Basic prime number generator
2 people like thisPosted: 7 years ago by d95danb
A prime Eratosthenes' sieve, using a bit array and sieving only odd composites to conserve memory and keep things fast.
3 people like thisPosted: 7 years ago by Arjen Kopinga
A simple implementation for the sieve of Eratosthenes.
3 people like thisPosted: 6 years ago by Gab_km