use itertools::Itertools;

const PRIMES: [u64; 15] = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47];
const MAX_DIVISOR: usize = 64;

struct DivisorSeq {
    max_number_of_divisors: u64,
    index: u64,
}

impl DivisorSeq {
    fn new(max_number_of_divisors: u64) -> DivisorSeq {
        DivisorSeq {
            max_number_of_divisors,
            index: 1,
        }
    }
}

impl Iterator for DivisorSeq {
    type Item = u64;

    fn next(&mut self) -> Option<u64> {
        if self.max_number_of_divisors < self.index {
            return None;
        }
        #[allow(unused_mut)]
        let mut result: u64;
        let divisors_of_divisor = get_divisors(self.index);
        match divisors_of_divisor.len() {
            1 | 2 => {