Method Math.factor() Method factor array(int(-1..)) factor(int x) Description Factorize the integer x. The returned list of factors will be sorted biggest to smallest factor. Note In Pike versions prior to v8.0, only primes <= 8161 were considered.