static std::vector<int> factorize(const int N) { std::vector<int> factors; int n = N; while (n > 1) { const int n0 = smallest_divisor(n); factors.push_back(n0); n /= n0; } return factors; }
bool is_prime(int n) { return (n == smallest_divisor(n)); }