prime factorization algorithms