pub fn proper_factor<T: PrimInt + Unsigned + Roots>(n: T) -> Vec<T>Expand description
For all unsigned integer inputs, returns all factors of the number, excluding the number itself.
ยงExamples
assert_eq!(fast_factor::proper_factor(0_u32), vec![]);
assert_eq!(fast_factor::proper_factor(1_u32), vec![]);
assert_eq!(fast_factor::proper_factor(7_u32), vec![1]);
assert_eq!(fast_factor::proper_factor(12_u32), vec![1,2,3,4,6]);
assert_eq!(fast_factor::proper_factor(36_u32), vec![1,2,3,4,6,9,12,18]);