PolynomialRemainder[(x^100+1)^100+2(x^50+1)^50+3,x^2+x+1,x]