prime factorization functions