This util provides a few tools for working with prime numbers.
Mostly for personal use with project euler problems. :)
Rust
fn get_primes_less_than_x(x: u32) -> Vec<u32>
Generates an ordered list of prime numbers from 2 up to x (exclusive)
Uses the sieve of Eratosthenes under the covers.
Rust
fn get_prime_factors_with_counts(x: u32, primes: &Vec<u32>) -> HashMap<u32, u32>
To be used in conjunction with getprimeslessthanx. Be sure to pass in
primes
at least up to sqrt(x).