Input

# A is a polynomial in Z[x] # L is a list of monic images mod p k # p is a prime, B is a bound on the coefficients of the factors of A N ← |L| if lcoeff(a) = 1 then m ← Π N i=1 tcoeff(L i) (mod p k) if m |tcoeff(a) then return false m ← ΠL, q ← a prime q = p if lcoeff(a) = 1 then m ← integer ratrecon(m) if m =FAIL then return false else m ← integer primitive part(m) if m ∞ > B then return false if lcoeff(m) | lcoeff(a) then return false if m |a (mod q) then return false if m|a then Q ← quotient, M ← m, return true end 'factorrpoly' In brief the rest of the algorithm is as follows: 1. Input A ∈ Z[x] 2. Remove integer content 3. Find square free factorizations mod log (deg A) primes 4. Pick " best " prime (see example) 5. Lift monic modular images, trial dividing at each step, use rational reconstruction if necessary 6. Trial divide combinations of the remaining " bad " factors until all factors in Z[x] have been found 7. Return factors in Z[x] from each square free factor and content from step 2