How to use Mathematica to solve equations in a polynomial ring?

I am sorry. But I wonder whether it is fine to ask this question here.

I need some help to solve some equations in a polynomial ring:

Give the ring $\mathbb{F}_p [x ]/(x^2+x+1)$, where $p$ is a prime (for example $p=5$). I need to solve some equations like:

$(1-x)f_i(x)+x f_j(x)-f_k(x)=0$

I have no idea how to solve this in Mathematica. (Of course, we can solve them via pencil and paper. But it is a headache if it involves 20 or more equations.) Any help is appreciated.

My own approach was to set $f_i(x) = a+b x$ with $a,b \in \mathbb{F}_5$. Then try to solve the (linear) equations $mod\ 5$. But it failed because we may need $x^2+x+1=0$.

-

Use of substitutions could help here, x^2->-x-1. For arbitrary polynomial y with integer coefficients

qFp[y_,p_]:=((y//Expand) //.{x^n_ /;n>1->x^(n-2)(-x-1)//Expand}//Expand) /. a_Integer -> Mod[a, p]

will be an equal to $q(x)$ polynomial in $\mathbb F_p[x]$ of degree 1. For example,

qFp[x^5+7x+4,5]

gives

x+3

-
+1 Neat. Clearly I don't know enough about Mathematica. When I was learning it, AlgebraicRules was used in contexts like this, but that was clumsy. I need to try this the next time I need it! –  Jyrki Lahtonen Jul 1 '11 at 6:26