Prime number operations for Rust