BMO2 1997 - Combinatorics Find the number of polynomials of degree 5 with distinct coefficients from the set {1, 2, 3, 4, 5, 6, 7, 8} that are divisible by $x^2-x+1$. 
I tried multiplying $x^2-x+1$ by $ax^3+bx^2+cx+d$ to get $ax^5+(b-a)x^4+(a-b+c)x^3+(b-c+d)x^2+(c-d)x+d$, but I am struggling to count from here.

It's divisible by $x^2-x+1$ if and only if it vanishes at $\zeta=e^{\pi i/3}$. Now $$a\zeta^5+b\zeta^4+c\zeta^3+d\zeta^2+e\zeta+f=(d-a)\zeta^2+(e-b)\zeta+f-c$$ so we must have $d-a=b-e=f-c$. So you just have to count solutions of that system with the variables taking on distinct values from $1,\dots,8$. 
