public static boolean primitiveRootsExist(final int m) {
        notLessThanCheck(m, 2);
        if ((m == 2) || (m == 4) || (isPrime(m)))
            return true;
        
        final List<Pair<Integer, Integer>> factorization = factorize(m);
        final int factSize = factorization.size();
        if (factSize > 2)
            return false;
        
        final Pair<Integer, Integer> a = factorization.get(0);
        final int aFirst = a.getFirst();
        if (factSize == 1) // m must be a power of odd prime
            return (aFirst > 2) && (isPrime(aFirst));
        
        // factSize == 2, m must be double of a power of odd prime
        final Pair<Integer, Integer> b = factorization.get(1);
        final int bFirst = b.getFirst();
        return (aFirst == 2) && (a.getSecond() == 1) &&
                (bFirst > 2) && (isPrime(bFirst));
    }