private static List<Integer> binomialCongruenceSolve(final int n, final int a,
            final int m, final int maxSolutions) {
        
        final List<Integer> result = new ArrayList<>();
        for (int i = 0; i < m; ++i) {
            if (modPow(i, n, m) == a) {
                result.add(i);
                if (result.size() == maxSolutions)
                    break;
            }
        }
        if (!result.isEmpty())
            result.add(m);
        return binomialCongruenceRuleOut(result);
    }