The factorization of a polynomial defined by partitions