package com.github.ahitrin.jqexample;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Andrey Hitrin
 * @since 25.09.14
 */
public class PrimeFactors
{
    public static List<Integer> extract(Integer number)
    {
        List<Integer> factors = new ArrayList<>();
        for (int divisor = 2; divisor <= number; divisor++) {
            while ((number > divisor) && (number % divisor == 0)) {
                factors.add(divisor);
                number = number / divisor;
            }
        }
        factors.add(number);
        return factors;
    }
}

@@ -32,16 +32,39 @@
 ample;%0A%0A
+import java.lang.Math;%0A
 import j
@@ -341,22 +341,37 @@
 isor %3C= 
+Math.sqrt(
 number
+) + 1
 ; diviso

Make it fast!