Polynomial division and remainders