pub trait IsPrime {
fn is_prime(&self) -> bool;
}
pub trait IsSquare {
fn is_square(&self) -> bool;
}
pub trait IsPower {
fn is_power(&self) -> bool;
}
pub trait ExpressAsPower: Sized {
fn express_as_power(&self) -> Option<(Self, u64)>;
}
pub trait Factor {
type FACTORS;
fn factor(&self) -> Self::FACTORS;
}
pub trait Primes {
type I: Iterator<Item = Self>;
type LI: Iterator<Item = Self>;
fn primes_less_than(n: &Self) -> Self::LI;
fn primes_less_than_or_equal_to(n: &Self) -> Self::LI;
fn primes() -> Self::I;
}
pub trait PrimitiveRootPrime {
type Output;
fn primitive_root_prime(&self) -> Self::Output;
}